Re: [racket] Rosetta Code Minesweeper Implementation

2013-06-05 Thread Neil Toronto
On 06/03/2013 02:26 PM, Sean Kanaley wrote: It's surprising how difficult a seemingly easy task like cloning minesweeper can be. Ultimately this took several hours for what I thought would be 30-60 minutes. Heh. :) Also I couldn't find a way to make a mutable-array immutable with anything re

Re: [racket] Rosetta Code Minesweeper Implementation

2013-06-03 Thread Matthias Felleisen
Consider a random testing approach. Throw the random tester at the main function, Think of 'streams' of input that the main function can absorb, and generate random streams . On Jun 3, 2013, at 5:14 PM, Sean Kanaley wrote: > Just kidding there are more parse bugs, but I'm doing my best to fix

Re: [racket] Rosetta Code Minesweeper Implementation

2013-06-03 Thread Sean Kanaley
Just kidding there are more parse bugs, but I'm doing my best to fix them. The consolation is that the other implementations are either far longer, incorrect, or both. Still... I shall post it shortly and hope for the best. On Mon, Jun 3, 2013 at 4:26 PM, Sean Kanaley wrote: > Thank you both f

Re: [racket] Rosetta Code Minesweeper Implementation

2013-06-03 Thread Sean Kanaley
Thank you both for the replies. I have incorporated all of your suggestions. The thin board wrapper over vector2 proved useful to quickly switch everything over to arrays. The program should no longer crash due to user input aside from any kind of internal buffer issues that may or may not be po

Re: [racket] Rosetta Code Minesweeper Implementation

2013-06-03 Thread Vincent St-Amour
Nice game! You may want to look into the `math/array' library. It should provide all the grid operations you need. Vincent At Mon, 3 Jun 2013 11:03:16 -0400, Sean Kanaley wrote: > > Hello all, > > Rosetta Code does not have a minesweeper implementation in Racket. I have > created the one sho

Re: [racket] Rosetta Code Minesweeper Implementation

2013-06-03 Thread Matthias Felleisen
Please pre-process inputs so that invalid inputs -- '! 4 4' or worse '1' -- don't crash the program. It should be easy to do. Also print instructions as run boots up. -- Matthias On Jun 3, 2013, at 11:03 AM, Sean Kanaley wrote: > Hello all, > > Rosetta Code does not have a minesweeper impl

[racket] Rosetta Code Minesweeper Implementation

2013-06-03 Thread Sean Kanaley
Hello all, Rosetta Code does not have a minesweeper implementation in Racket. I have created the one shown below. Before I post it to Rosetta, I was looking for possible feedback to shorten, make clearer, make "safer" in some way, make more use of library functions, etc. I would hate to give Ra