[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Programming Challenge

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 9
Thread images: 5

File: prehistoric-owl1.jpg (53KB, 432x435px) Image search: [Google]
prehistoric-owl1.jpg
53KB, 432x435px
Quick! Write a solver for this mutagen puzzle or the cloned prehistoric owl will pluck out your eyes!

import re

data = [
'exit1 rd jv if vd wu r5 jj j9 rc j7 xs dw km',
'ovid3 j7 wu if xs jj -f5 -km -xu -dw',
'echo3 if rd xs xu km -jv -va -nj -dw -j9',
'echo2 km rd rc wu jv sb gs -uo -r5 -xs',
'echo4 dw sb uo r5 vd xs -gs -xu',
'soli1 if jv j9 r5 -dw -nj -rd',
'soli2 jv uo xs nj',
'ovid2 xu dw jj j9 rc gs -nj',
'io3 if r5 km vd xu -jj -va',
'io2 jj sb j7 uo',
'heli3 va sb rd vd -r5',
'heli2 rd dw km -nj -gs -sb',
'echo1 gs dw wu nj -km',
'heli1 j7 rc -jj -if -nj -uo',
'io1 nj wu jj',
'ovid1 rd jv if xu vd'
]

data = [re.split(r'\s+', d.lower()) for d in data]
target = data[0][1:]


The first word in each data-string is the name of the mutagen (exit1, ovid3, echo3, ...).

Starting from an empty sequence, reproduce the target sequence of the exit1 mutagen from the other mutagens to kill the owl:
['rd', 'jv', 'if', 'vd', 'wu', 'r5', 'jj', 'j9', 'rc', 'j7', 'xs', 'dw', 'km']


You are not allowed to use the exit1 mutagen.

Applying a mutagen appends its new and unprefixed dna strings to the previous sequence. Strings already present in the sequence are NOT added again. Then the dna strings prefixed by "-" are removed.
So a mutagen adds its unprefixed dna strings and removes the ones prefixed by "-".

For instance, applying ovid1 and then echo3 to an empty sequence gives these results:

[] # empty
['rd', 'jv', 'if', 'xu', 'vd'] # after ovid1
['rd', 'if', 'xu', 'vd', 'xs', 'km'] # then after echo3


Write a program that finds which mutagens to apply in which order to reproduce the target sequence (exit1) und use it to solve the puzzle. Your program should finish within 30 seconds, but it's possible to write one that finishes within 1.
>>
the owl was confirmed fake
>>
File: prehistoric-owl2.jpg (176KB, 800x716px) Image search: [Google]
prehistoric-owl2.jpg
176KB, 800x716px
The owl is approaching.
>>
File: enhanced-30396-1455840762-1.jpg (60KB, 600x338px) Image search: [Google]
enhanced-30396-1455840762-1.jpg
60KB, 600x338px
>mutagen
>>
Don't tell me this is too hard for you.
>>
File: owl.webm (227KB, 800x728px) Image search: [Google]
owl.webm
227KB, 800x728px
It's not looking good for you.
>>
The owl is set.
>>
>>57635715
You watch what you say. The brave ones are always the first to die.
>>
File: youaredead.webm (488KB, 800x710px) Image search: [Google]
youaredead.webm
488KB, 800x710px
The owl eats your face. The gurgling sounds of your death throes call your mother onto the scene. She sighs in disappointment, and mild relief.
Thread posts: 9
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.