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! π
######################################################
|