tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
16
Task/Reverse-a-string/Modula-3/reverse-a-string.mod3
Normal file
16
Task/Reverse-a-string/Modula-3/reverse-a-string.mod3
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
MODULE Reverse EXPORTS Main;
|
||||
|
||||
IMPORT IO, Text;
|
||||
|
||||
PROCEDURE String(item: TEXT): TEXT =
|
||||
VAR result: TEXT := "";
|
||||
BEGIN
|
||||
FOR i := Text.Length(item) - 1 TO 0 BY - 1 DO
|
||||
result := Text.Cat(result, Text.FromChar(Text.GetChar(item, i)));
|
||||
END;
|
||||
RETURN result;
|
||||
END String;
|
||||
|
||||
BEGIN
|
||||
IO.Put(String("Foobarbaz") & "\n");
|
||||
END Reverse.
|
||||
Loading…
Add table
Add a link
Reference in a new issue