POV-Ray : Newsgroups : povray.off-topic : My first C++ program : Re: A test Server Time
1 Oct 2024 07:20:15 EDT (-0400)
  Re: A test  
From: Warp
Date: 20 Sep 2008 15:48:43
Message: <48d5539b@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.