-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
okx-code edited this page Aug 5, 2018
·
3 revisions
Increment base-36 strings, 10 bytes
ĠḞḊĖȦDĊ36C
- Firstly,
Ġ
(remove first character) is called with the argumentḞḊĖȦDĊ36C
- Then,
Ḟ
(convert to base) is called withḊĖȦDĊ36
andC
. -
Ḋ
(increment) is called withĖȦDĊ36
-
Ė
(convert from base) is called withȦDĊ
and36
. -
Ȧ
(concatenate) is called withD
andĊ
. -
D
is the loop variable, but since we are not in a loop it defaults to 1. -
Ċ
gets a line of input, and evaluates it,"123456zzzz"
for example. -
ȦDĊ
results in1123456zzzz
. -
ĖȦDĊ36
converts x (the first argument) from base y (the second argument), which results in3763604730256127
. -
ḊĖȦDĊ36
increments its first argument, so you get3763604730256128
. -
ḞḊĖȦDĊ36C
converts x to base y. The functionC
represents the integer that was last used, in this case it was36
, so it converts3763604730256128
to base 36, which is11234570000
. -
ĠḞḊĖȦDĊ36C
removes the first character from its argument, so you get1234570000
. - Now all functions have been evaluated,
"1234570000"
is printed.