76
Community Contests / Codegolf - The Reboot #6
« 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.
The output for the example "map" above would be `A, D`. The pattern for the falling balls would look something like this:
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
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