Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Damm-algorithm/Forth/damm-algorithm.fth
Normal file
17
Task/Damm-algorithm/Forth/damm-algorithm.fth
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
: newdigit ( col row -- u ) 10 * + C" 0317598642709215486342068713591750983426612304597836742095815869720134894536201794386172052581436790" 1+ + c@ 48 - ;
|
||||
: nextdigit ( addr -- addr+1 u ) dup c@ 48 - swap 1+ swap ;
|
||||
|
||||
: damm ( c u -- u )
|
||||
0 rot rot
|
||||
0 do
|
||||
nextdigit
|
||||
rot newdigit swap
|
||||
loop drop
|
||||
;
|
||||
|
||||
: isdamm? damm 0= if ." yes" else ." no" then ;
|
||||
|
||||
: .damm
|
||||
2dup damm
|
||||
rot rot type 48 + emit
|
||||
;
|
||||
Loading…
Add table
Add a link
Reference in a new issue