Author Topic: Code Golf - The Reboot #10  (Read 27697 times)

0 Members and 1 Guest are viewing this topic.

Offline c4ooo

  • Project Author
  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Code Golf - The Reboot #10
« on: August 02, 2015, 11:59:59 pm »
Hello ladies, gentlemen, and Pegasi of omnimaga! It seems that the circle is complete and that it is my turn to host again! Without further adu, welcome to the 00001010th installation of ....
Code Golf: The Reboot!

Don't know what code golf is?, read this paragraph by @JWinslow:
Don't know what code golf is? Check out this contest thread OR this really old contest thread for an explanation. Don't know what code is? Then you will not understand this website in general :P
So, here is your challenge:
Today you have gotten yourself a new job at a company that produces touch screen devices. Being part of the security department, it is your job to design and program a password protection system for the device. You decide to steal a design that is currently popular on the market, and involves the user connecting cells with lines by sliding their fingers across the screen.
The next day your boss approves on your plan, and you decide that the size of the cell grid should be 5*5. The start will be the top left corner, and the end the bottom right corner. The user will have to to drag their finger from the start to the end while going over every cell. From a cell the user can drag to any adjacent cell, be it horizontally, vertically, or diagonally, as long as they do not drag over the same cell twice, and they do not frag out of bounds. The user is successful if they dragged over every cell and are currently at the end. If they reach the end without dragging over every cell, or attempt to drag over the same cell twice, then they are unsuccessful. The user is also unsuccessful if they drag out of bounds.
This is an example of a success: (taken from your scratch pad)

These two are examples of fails: (also taken from your scratch pad)

and

Input
For input, you must read 25 characters from stdin, or your languages closest alternative. Each of the 25 characters will represent a move,and will be a  number 1-8, 1 being go up, 2 up and right, 3 right, and so on in a clockwise fashion. The input is not a list of moves to make, but rather a road map to follow. For example, if you are at cell {3,4}, then you will have to read character {3,4} to make your next move. Hint: You will have to treat the 25 chars as a 5*5 multi dimensional array. Due to  the last character being the finish, its state should not affect the program.
Output
Open reaching the end with every cell passed, you must print a positive result. Open passing the same cell twice, reaching the end without passing every cell, or going out of bounds, your program must print a negative result. The "negative" and "positive" results must be unique, and be consistent over multiple runs.
Example: (An "x" does not affect the outcome of a program)
For input

44446
XXX6X
XX6XX
X6XXX
4444X

The move map should look like this:

And should be a fail because not all the spaces where transversed.

Scoring

All non-calc languages will be scored with this counter, courtesy @Juju.
All Assembly programs will be scored on binary size, and TI-BASIC and Axe will be scored on on-calc source size (minus tios header). The Axe header does count.

Submission

PM me over on Omnimaga,or shoot me an email [email protected] with the code to submit your entry.

Well, i think this is the end, i will add a scoreboard once i get some entries, which i hope i will get (activity seems to be going down ._.) If you have any questions/would like me to clarify something, feel free to ask.
« Last Edit: August 04, 2015, 12:52:04 pm by c4ooo »
-German Kuznetsov
The impossible chemical compound.