-
Notifications
You must be signed in to change notification settings - Fork 0
/
shout_it_out_loud_minimalist.rock
23 lines (23 loc) · 1.31 KB
/
shout_it_out_loud_minimalist.rock
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
counter is abcdefghi abcdefg (counter = 97)
bound is a ab ab (bound = 122)
diff is abc ab (diff = 32)
Until counter is higher than bound (loop until counter > bound)
cast counter into key (key = counter cast to character)
let upper be counter without diff (upper = counter - diff)
cast upper into value (value = upper cast to character)
let mapping at key be value (mapping[key] = value)
build counter up (counter++)
(close until loop)
listen to input (read stdin into input)
split input into chars (split string into character array)
rock result (initialize empty array: result)
while chars ain't nothing (while array size > 0)
roll chars into char (pop top element)
let upper be mapping at char (upper = mapping[char])
if upper is nothing (if no value was found; upper = null)
put char into upper (upper = char)
(end if)
rock upper into result (push upper into result list)
(close while loop)
join result (convert char array to string)
say result (print result to stdout)