Orchid XP v8 <voi### [at] devnull> wrote:
> module Main where
> import System.Random
> main = do
> target <- randomRIO (1, 100)
> guess target
> guess target = do
> putStr "Guess: "
> txt <- getLine
> let number = read txt :: Int
> case compare number target of
> LT -> do putStrLn "Too low."; guess target
> GT -> do putStrLn "Too high."; guess target
> EQ -> do putStrLn "You win!"
Now you'll have to implement the same program in C++. ;)
--
- Warp
Post a reply to this message
|