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を愛でる。 その9

Posted at

#概要

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

#練習問題

zundokoを、表示せよ。

#考え方

乱数の求め方
0から8の乱数を得る。

  push  "9"
  rnd

#サンプルコード

loop  push  "9"
  rnd
  push  "4"
  >
  !
  if  skip0
  push  "a"
  push  "0"
  set
  push  "x"
  push  "x"
  get
  push  "doko "
  add
  set
  jp  loop
skip0  push  "x"
  push  "x"
  get
  push  "zun "
  add
  set
  push  "a"
  push  "a"
  get
  ++
  set
  push  "a"
  get
  push  "4"
  >
  !
  if  skip1
  jp  loop
skip1  push  "x"
  push  "x"
  get
  push  "doko kiyoshi!"
  add
  set
  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?