Calculator Community > Community Contests

Codegolf - The Reboot #6

(1/2) > >>

Ivoah:
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: ---( )(*)( )( )
( )( )(*)( )
( )( )(*)( )
(*)( )( )( )
( )(*)( )( )
( )( )( )(*)
( )(*)( )( )
(*)( )( )( )
( )( )(*)( )
( )(*)( )( )

--- End code ---

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


--- Code: ---(|)(*)(\)(|)
(|)( )(*)(|)
(\)( )(*)(|)
(*)(\)( )(|)
( )(*)(|)(/)
( )( )(|)(*)
( )(*)(|)( )
(*)( )(^)( )
( )(/)(*)(\)
(|)(*)( )(|)

--- End code ---

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

Juju:
It looks kinda hard, but that should be doable.

Ivoah:

--- Quote from: Juju on July 06, 2015, 07:57:42 pm ---It looks kinda hard, but that should be doable.

--- End quote ---

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.

c4ooo:
So if encountering a bubble the ball should split? I think i can do this!

Ivoah:

--- Quote from: c4ooo on July 07, 2015, 09:31:42 pm ---So if encountering a bubble the ball should split? I think i can do this!

--- End quote ---

Correct.

Navigation

[0] Message Index

[#] Next page

Go to full version