Something simple

Chad Wilson chadrwilson at gmail.com
Thu Jul 17 11:56:21 EDT 2008


I am a gamer.  Table top RPGs, war games, board games, etc.  Since my laptop
is pen-based, I has been handier to keep it at the table than paper.  As a
result, I have been experimenting with making dice rollers to have yet
another item not needed on the table.  Sure, it takes away some of the
tradition, but it makes for carrying fewer things.  I have written various
dice roll simulators in xblite, ruby and some other dynamics, but this seems
like an interesting exercise to try in Haskell.

My first goal is to figure out how to get the command-line arguments.  As I
did with the other languages, my first program in this development simply
retrieved the arguments and printed them.  So, here it is.

import System.Environment

main = do
  args <- getArgs
  print args

Very simple and to the point.  Now I need to dig into the manual and figure
out the next simple progression...taking 2 arguments and doing something to
them akin to:

roll 1 6

This would roll 1, 6-sided die, or 1d6 in gamer terms and print the result.

I figure the best way to learn a new language is to apply it something I
might actually use it for.

-- 
Chad Wilson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20080717/f089315c/attachment.htm


More information about the Beginners mailing list