0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

plunkerでeasyforth その2

Last updated at Posted at 2025-11-21

概要

easyforth、見つけたのでやってみた。

forthの定義済みワード

ワード 意味
. スタックトップを取り出し表示
emit スタックトップを取り出し文字表示
.s デバッグプリント
cr 改行表示
." 文字列表示
space 空白表示
+ スタックトップと2番の加算
- スタックトップと2番の減算
* スタックトップと2番の乗算
/ スタックトップと2番の除算
mod スタックトップと2番の剰余
= スタックトップと2番の同値
< スタックトップと2番より小さい
> スタックトップと2番より大きい
max スタックトップと2番の最大
min スタックトップと2番の最小
dup スタックトップの複製
swap スタックトップと2番の交換
drop スタックトップの除去
over スタックの2番目の複製
rot スタックの上位3つを回転し,3番目をトップへ
and スタックトップと2番のBit AND
or スタックトップと2番のBit OR
invert スタックトップと2番のBit 反転
random 乱数(スタックトップ)
key キー入力
: 関数宣言
if then トップが1なら実行
if else then トップが1ならこっち、0ならこっち
do loop 2番からトップまで繰り返す
begin until 1の間繰り返す
: 宣言終了

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?