[Haskell-beginners] Ruby Quiz Solution #15 - won't work after compilation

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Thu Aug 14 16:03:35 EDT 2008


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 at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Beginners mailing list