tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
6
Task/Repeat-a-string/Forth/repeat-a-string-1.fth
Normal file
6
Task/Repeat-a-string/Forth/repeat-a-string-1.fth
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
: place-n { src len dest n -- }
|
||||
0 dest c!
|
||||
n 0 ?do src len dest +place loop ;
|
||||
|
||||
s" ha" pad 5 place-n
|
||||
pad count type \ hahahahaha
|
||||
7
Task/Repeat-a-string/Forth/repeat-a-string-2.fth
Normal file
7
Task/Repeat-a-string/Forth/repeat-a-string-2.fth
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
: place-n ( src len dest n -- )
|
||||
swap >r 0 r@ c!
|
||||
begin dup while -rot 2dup r@ +place rot 1- repeat
|
||||
r> 2drop 2drop ;
|
||||
|
||||
s" ha" pad 5 place-n
|
||||
pad count type \ hahahahaha
|
||||
2
Task/Repeat-a-string/Forth/repeat-a-string-3.fth
Normal file
2
Task/Repeat-a-string/Forth/repeat-a-string-3.fth
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
pad 10 char * fill \ repeat a single character
|
||||
pad 10 type \ **********
|
||||
Loading…
Add table
Add a link
Reference in a new issue