haskell : F:\test\Guess.hs:11:16: parse error on input `='

发布网友 发布时间:2022-04-23 09:46

我来回答

1个回答

热心网友 时间:2023-10-10 00:06

mole Main where

import IO
import Random

doGuessing num = do
putStrLn "Enter your guess:"
guess <- getLine
let guessNum = read guess
if guessNum < num
then do putStrLn "Too Low!"
doGuessing num
else if guessNum > num
then do putStrLn "Too High!"
doGuessing num
else do putStrLn "Right!"

main = do
hSetBuffering stdin LineBuffering
num <- randomRIO (1::Int, 100)
putStrLn "I'm thinking of a number between 1 and 100"
doGuessing num

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com