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?

More than 3 years have passed since last update.

stack machineを愛でる。 その7

Posted at

#概要

stack machineが、好きだ。
練習問題、やってみた。

#練習問題

九九を、表示せよ。

#考え方

変数iとjを1から9まで、回す。
i * j を 変数xに追加する。

#サンプルコード

  push  "x"
  push  ""
  set 
  push  "i"
  push  "1"
  set
loop1  push  "j"
  push  "1"
  set
loop0  push  "x"
  push  "x"
  get
  push  "i"
  get
  push  "j"
  get
  *
  add
  push  " "
  add
  set
  push  "j"
  push  "j"
  get
  ++
  set
  push  "j"
  get
  push  "10"
  >
  !
  if  skip0
  jp  loop0
skip0  push  "x"
  push  "x"
  get
  push  " / "
  add
  set
  push  "i"
  push  "i"
  get
  ++
  set
  push  "i"
  get
  push  "10"
  >
  !
  if  skip2
  jp  loop1
skip2  end


#成果物

以上。

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?