VOOZH about

URL: https://qiita.com/ohisama@github/items/40d82a89d08264bd1809

⇱ stack machine アセンブラ その3 #FizzBuzz - Qiita


👁 Image
1

Go to list of users who liked

0

Share on X(Twitter)

Share on Facebook

Add to Hatena Bookmark

More than 5 years have passed since last update.

@ohisama@github

stack machine アセンブラ その3

1
Last updated at Posted at 2014-09-01

fizz buzz

 push "x"
 push ""
 set
 push "i"
 push "0"
 set
loop push "i"
 push "i"
 get
 ++
 set
 get
 push "i"
 get
 push "15"
 %
 push "1"
 >
 if skip2
 push "i"
 get
 push "5"
 %
 push "1"
 >
 if skip1
 push "i"
 get
 push "3"
 %
 push "1"
 >
 if skip0
 push "x"
 push "x"
 get
 push "i"
 get
 add
 set
 push "x"
 push "x"
 get
 push " "
 jp skip3
skip0 push "x"
 push "x"
 get
 push "fizz "
 jp skip3
skip1 push "x"
 push "x"
 get
 push "buzz "
 jp skip3
skip2 push "x"
 push "x"
 get
 push "fizzbuzz "
skip3 add
 set
 push "i"
 get
 push "100"
 >
 if loop
 end

実行環境

stack machineは、flashです。
webで実行
jsdo ohisama1

1

Go to list of users who liked

0
0

Go to list of comments

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
1

Go to list of users who liked

0