Jahooma 2: Insanity

A single puzzle of hellish difficulty.

Puzzle 2.1: Error-prone Substring (Extreme)
Given an input in the form “start,length,string” (without quotes) where start and length are nonnegative integers and string is a string not containing any asterisk, output substr(string, start, length). That is, starting from the start-th letter (zero-indexed), take the next length characters. It is guaranteed that start + length is less than or equal to the length of the string.

Boxes:
Circular Add asterisk (adds an asterisk in front of the string)
Circular Add period (adds an period in front of the string)
Circular Add zero (adds a zero in front of the string)
Circular Copy (copies the first character of the string to the end of the string)
Circular Delete (deletes the first character of the string)
Circular Compare (compares the first character and the second character of the string; if they are equal, exit green, otherwise exit red; the input is unchanged)
Circular Rotate (moves the first character of the string to the end of the string)
Square Rotate (moves the first character of the string to the front of the first asterisk in the original string or to the end of the string if no asterisk is found)
Circular Increment (increments the first character of the string (0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 -> 7 -> 8 -> 9 -> 0; * -> *; . -> .))
Circular Save (copies the first character of the string to the storage stack)
Circular Store (moves the first character of the string to the storage stack)
Circular Load (moves the topmost character of the storage stack to the front of the string)
Circular Is asterisk (implemented from your solution to Puzzle 1.1, replacing period with asterisk)
Circular Find asterisk (implemented from your solution to Puzzle 1.2, replacing period with asterisk)
Circular Is period (implemented from your solution to Puzzle 1.1)
Circular Find period (implemented from your solution to Puzzle 1.2)
Square Back rotate (implemented from your solution to Puzzle 1.3)
Square Increment Nonnegative Number (implemented from your solution to Puzzle 1.4)

Sample cases:
– “1,2,abcd” -> “bc”
– “0,1,abcd” -> “a”
– “0,0,” -> “”
– “3,3,3,3,3,3,3” -> “,3,”
– “11,11,the insane chaotic_iak posts another puzzle again” -> “chaotic_iak”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s