POV-Ray : Newsgroups : povray.off-topic : My first C++ program : A test Server Time
1 Oct 2024 07:20:36 EDT (-0400)
  A test  
From: Orchid XP v8
Date: 20 Sep 2008 14:21:58
Message: <48d53f46@news.povray.org>
Nicolas Alvarez wrote:

> I understand the C++ one and the Haskell one looks like line noise.

OK, well how about this:



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!"



Does that look like line noise to you? Or can you figure out what that does?

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

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