Omnimaga

Calculator Community => Contests => Community Contests => Topic started by: Ivoah on July 06, 2015, 09:54:24 am

Title: Codegolf - The Reboot #6
Post by: Ivoah on July 06, 2015, 09:54:24 am
While taking PSAT practice tests, I invented a sort of game to be played on the answer grid. For those who don't know what the PSAT answer sheet looks like, it's basically a 4 by X grid of bubbles, with each row representing a different problem, and each bubble in the row representing an answer choice. I would pretend that four balls began falling down the top of the grid, and the filled bubbles would block their path and cause them to split. The goal of this contest is to display the columns where balls will exit.

Only one bubble will be filled per row, and no row can be. blank. A ball will continue down a column if there is no bubble in that column, and if there is, it will split and move to the two columns on either side only if there is no wall and no filled bubble above it.

Code: [Select]
( )(*)( )( )
( )( )(*)( )
( )( )(*)( )
(*)( )( )( )
( )(*)( )( )
( )( )( )(*)
( )(*)( )( )
(*)( )( )( )
( )( )(*)( )
( )(*)( )( )

The output for the example "map" above would be `A, D`. The pattern for the falling balls would look something like this:

Code: [Select]
(|)(*)(\)(|)
(|)( )(*)(|)
(\)( )(*)(|)
(*)(\)( )(|)
( )(*)(|)(/)
( )( )(|)(*)
( )(*)(|)( )
(*)( )(^)( )
( )(/)(*)(\)
(|)(*)( )(|)

All entries must be complete, no code snippets allowed. The input will be in the form of `yxyy<newline>yyxy` with `y` representing an empty space, `x` a filled bubble, and <newline> representing a newine. `x` and `y` may be replaced with any character you want. The program may receive input through STDIN or read a file. The program output may be any legible form, eg. `{1,0,0,1}`, `1001`, `AD`, `A, D`, `{true, false, false, true}`. All BASIC and Axe entries will be scored on source size, minus the VAT header, asm (calc or computer) entries will be scored on binary size (minus VAT header if on calc), and computer entries will be scored on source size. If there are any questions, please ask. You can submit your entry by PM'ing it to me here, or on IRC on freenode or efnet.

Scores:

Juju: Ruby, 101 bytes
gudenau: Java, 616 bytes
Title: Re: Codegolf - The Reboot #6
Post by: Juju on July 06, 2015, 07:57:42 pm
It looks kinda hard, but that should be doable.
Title: Re: Codegolf - The Reboot #6
Post by: Ivoah on July 06, 2015, 08:54:44 pm
It looks kinda hard, but that should be doable.

I think the hardest part will be trying to understand what the requirements actually are, it was pretty hard to phrase, and some people have told me the didn't know what they were supposed to do.
Title: Re: Codegolf - The Reboot #6
Post by: c4ooo on July 07, 2015, 09:31:42 pm
So if encountering a bubble the ball should split? I think i can do this!
Title: Re: Codegolf - The Reboot #6
Post by: Ivoah on July 07, 2015, 09:33:20 pm
So if encountering a bubble the ball should split? I think i can do this!

Correct.
Title: Re: Codegolf - The Reboot #6
Post by: c4ooo on July 07, 2015, 10:22:46 pm
I feel like the answer to this lies in some insane math equation, one that only @lirtosiast can find ;D
Title: Re: Codegolf - The Reboot #6
Post by: Ivoah on July 07, 2015, 10:23:15 pm
I feel like the answer to this lies in some insane math equation, one that only @lirtosiast can find ;D
None that I know of :P
Title: Re: Codegolf - The Reboot #6
Post by: Juju on July 08, 2015, 04:19:53 am
I did it! Got it down to 116 bytes in Ruby, pretty easy when you think about it.