I uploaded my Minesweeper clone, cl-mines to GitHub a few days ago. It's just a simple, command-line Minesweeper game. It doesn't really have a proper build process yet.
I've only tested it on SBCL, but there isn't any SBCL-specific code that I'm aware of and it is, by far, not the most complicated piece of Lisp code out there, so it should work with other Common Lisp implementations.
Wednesday, August 26, 2009
Friday, August 21, 2009
Releasing Some Code to GitHub
I'm going to be releasing a bunch of code to my GitHub over the next few weeks, after I clean up some of it and fix a few design issues and small bugs. This should include:
- Minesweeper clone
- Command-line Twitter tools
Sunday, August 2, 2009
Cute Perl Gem to Get the Minimum/Maximum Value
Saw this little nugget on #perl@irc.perl.org the other night. It determines the minimum of two values:
It takes advantage of the fact that Perl doesn't have a boolean return type for true or false, so the comparison operators return 1 or 0 for true and false, respectively, which are then used by this code to index the array ref.
To get the maximum of the two values, just flip the operator to >=
[$b, $a]->[$a <= $b]
It takes advantage of the fact that Perl doesn't have a boolean return type for true or false, so the comparison operators return 1 or 0 for true and false, respectively, which are then used by this code to index the array ref.
To get the maximum of the two values, just flip the operator to >=
Subscribe to:
Posts (Atom)