File: Tutorial_1.sor

package info (click to toggle)
libnumbertext 1.0.11-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,380 kB
  • sloc: python: 439; cpp: 395; java: 244; javascript: 108; makefile: 101; xml: 84; sh: 40
file content (116 lines) | stat: -rw-r--r-- 2,529 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Soros Tutorial – Part One πŸ”’  Three, Two, One...
#
# INTRODUCTION
#
# Soros programming language is for number to
# number name conversion. It’s based on regular
# expressions, the popular text processing
# tool of modern programming languages. So if you
# don’t want to convert numbers to number names,
# it’s still worth to check this tutorial, because
# most parts are about regular expressions,
# giving useful information for modern C++, Java,
# JavaScript, Python etc. programming, too.
# If you know regular expressions well, you can
# jump to the last part of the tutorial!
#
# In this part, we will learn the base syntax of
# Soros, writing small programs to convert
# input numbers to numbers and colorful (at least
# in Mozilla Firefox) emojis!
#
#
#
# TASK 1 – HELLO, WORLD!
#
# A Soros program consists of program lines.
#
# A program line is an input text and an output text
# separated by (the first) space:
#
# input_text output text
#
# Following program line replaces the input text β€œ0”
# with the output text β€œHello, 🌍!”, as you can see
# in the right output list window, which shows the
# output of the first 120 integer numbers, including
# this one:

0 Hello, 🌍!

# Replace β€œHello, 🌍!” with β€œzero” in the previous line,
# and check the same change in the right output window
# list!
#
# Write here a new program line to convert the input
# text β€œ1” to β€œone”!



# TASK 2 – The early bird catches the worm.
#
# First matching program line gives result.
#
# Remove the line with the bird COMPLETELY, and
# then the line with the worm! During these, check
# the results in the right output list window!

2 🐦
2 πŸ›
2 two



# TASK 3 – Three blind mice
#
# Input text without matching program line, or a
# matching program line without output text
# results empty output text.
#
# Remove the character # (sign of comment line)
# before 3 in the following line to hide the mice!

#3
3 🐁🐁🐁



# TASK 4 – Five little speckled frogs
#
# Modify the following program lines to get correct
# number of frogs for the input number 5 and 4!

5 🐸🐸🐸🐸🐸🐸
4 🐸🐸🐸🐸🐸🐸

SCROLL DOWN FOR SOLUTION
⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩⇩




















# Solution – TASK 4
#
# 5 🐸🐸🐸🐸🐸
# 4 🐸🐸🐸🐸


######################################################
# CONGRATULATIONS – You have finished Tutorial One! πŸ™‚
######################################################