New instructions, updated examples
This commit is contained in:
@ -2,10 +2,10 @@ INT i
|
||||
INT im
|
||||
SET i 99
|
||||
:beg
|
||||
OUT bottles of beer on the wall,$i$ bottles of beer\n
|
||||
CP im i
|
||||
DEC im 1
|
||||
OUT Take one down and pass it around, $im$ bottles of beer on the wall\n
|
||||
DEC i 1
|
||||
OUT bottles of beer on the wall,$i$ bottles of beer\n
|
||||
CP im i
|
||||
DEC im 1
|
||||
OUT Take one down and pass it around, $im$ bottles of beer on the wall\n
|
||||
DEC i 1
|
||||
JME beg i 1
|
||||
END
|
||||
|
@ -2,10 +2,17 @@ INT tot
|
||||
INT n
|
||||
INT j
|
||||
INT te
|
||||
IN INT tot numero massimo
|
||||
SET n 0
|
||||
IN INT tot numero massimo
|
||||
SET n 1
|
||||
:scn
|
||||
SET j 1
|
||||
OUT $n$\n
|
||||
:sieve
|
||||
MOD n j te
|
||||
JE sieve tot
|
||||
OUT $n$
|
||||
OUT j: $j$ \n
|
||||
OUT te: $te$ \n
|
||||
INC j
|
||||
JME scn j n
|
||||
JM sieve te 0
|
||||
INC n
|
||||
JLE scn n tot
|
||||
|
@ -4,7 +4,7 @@ INT w
|
||||
#initialize width
|
||||
INT h
|
||||
#initialize height
|
||||
IN INT w l
|
||||
IN INT w l
|
||||
#input height as an int
|
||||
IN INT h h
|
||||
#input width as an int
|
||||
@ -17,20 +17,20 @@ SET wr 0
|
||||
SET hr 0
|
||||
# set height counter to 0
|
||||
:wrc
|
||||
#row label
|
||||
:wf
|
||||
#column label
|
||||
OUT *
|
||||
#put char
|
||||
INC wr
|
||||
#increment width counter
|
||||
JL wf wr w
|
||||
#loop until desired width
|
||||
OUT \n
|
||||
#put newline char
|
||||
SET wr 0
|
||||
# set width counter to 0
|
||||
INC hr
|
||||
#row label
|
||||
:wf
|
||||
#column label
|
||||
OUT *
|
||||
#put char
|
||||
INC wr
|
||||
#increment width counter
|
||||
JL wf wr w
|
||||
#loop until desired width
|
||||
OUT \n
|
||||
#put newline char
|
||||
SET wr 0
|
||||
# set width counter to 0
|
||||
INC hr
|
||||
#increment height counter
|
||||
JL wrc hr h
|
||||
#loop until desired height
|
||||
|
Reference in New Issue
Block a user