Brent: getChar acts like getLine from what I can tell, it's a bit odd

On 8/14/08, Brandon S. Allbery KF8NH <allbery@ece.cmu.edu> wrote:

On Aug 14, 2008, at 15:13 , Brent Yorgey wrote:

On Thu, Aug 14, 2008 at 03:33:26PM +0100, Alex Watt wrote:
If I call "main" in ghci, my program runs as it should, but if I try
compiling it, and then running the result of that compilation, i.e.:

$ ghc -o animal_game game.hs
$ ./animal_game

unexpected things occur, particularly "getChar" does not work correctly, and

When you say 'getchar does not work correctly', exactly what do you
mean?  I'm not sure of the problem, but this smells to me of something
having to do with buffering and/or newline characters not getting
handled properly.

I'm thinking termios is in line mode still.  System.Posix.Terminal is what he needs.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery@kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery@ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH



_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners