Another update from ingydotnet^djgoku
This commit is contained in:
parent
91df62d461
commit
948b86eafa
7604 changed files with 108452 additions and 22726 deletions
12
Task/Empty-string/ALGOL-68/empty-string.alg
Normal file
12
Task/Empty-string/ALGOL-68/empty-string.alg
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
# declare a string variable and assign an empty string to it #
|
||||
STRING s := "";
|
||||
|
||||
# test the string is empty #
|
||||
IF s = "" THEN write( ( "s is empty", newline ) ) FI;
|
||||
|
||||
# test the string is not empty #
|
||||
IF s /= "" THEN write( ( "s is not empty", newline ) ) FI;
|
||||
|
||||
# as a string is an array of characters, we could also test for emptyness by #
|
||||
# checking for lower bound > upper bound #
|
||||
IF LWB s > UPB s THEN write( ( "s is still empty", newline ) ) FI
|
||||
Loading…
Add table
Add a link
Reference in a new issue