Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
3
Task/User-input-Text/Forth/user-input-text-1.fth
Normal file
3
Task/User-input-Text/Forth/user-input-text-1.fth
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
: INPUT$ ( n -- addr n )
|
||||
PAD SWAP ACCEPT
|
||||
PAD SWAP ;
|
||||
4
Task/User-input-Text/Forth/user-input-text-2.fth
Normal file
4
Task/User-input-Text/Forth/user-input-text-2.fth
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
: INPUT# ( -- u true | false )
|
||||
0. 16 INPUT$ DUP >R
|
||||
>NUMBER NIP NIP
|
||||
R> <> DUP 0= IF NIP THEN ;
|
||||
2
Task/User-input-Text/Forth/user-input-text-3.fth
Normal file
2
Task/User-input-Text/Forth/user-input-text-3.fth
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
: INPUT# ( -- n true | d 1 | false )
|
||||
16 INPUT$ SNUMBER? ;
|
||||
3
Task/User-input-Text/Forth/user-input-text-4.fth
Normal file
3
Task/User-input-Text/Forth/user-input-text-4.fth
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
: INPUT# ( -- n true | false )
|
||||
16 INPUT$ NUMBER? NIP
|
||||
DUP 0= IF NIP THEN ;
|
||||
8
Task/User-input-Text/Forth/user-input-text-5.fth
Normal file
8
Task/User-input-Text/Forth/user-input-text-5.fth
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
: input#
|
||||
begin
|
||||
refill drop bl parse-word ( a n)
|
||||
number error? ( n f)
|
||||
while ( n)
|
||||
drop ( --)
|
||||
repeat ( n)
|
||||
;
|
||||
6
Task/User-input-Text/Forth/user-input-text-6.fth
Normal file
6
Task/User-input-Text/Forth/user-input-text-6.fth
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
: TEST
|
||||
." Enter your name: " 80 INPUT$ CR
|
||||
." Hello there, " TYPE CR
|
||||
." Enter a number: " INPUT# CR
|
||||
IF ." Your number is " .
|
||||
ELSE ." That's not a number!" THEN CR ;
|
||||
Loading…
Add table
Add a link
Reference in a new issue