Explorar el Código

Print help in cesar

DricomDragon hace 5 años
padre
commit
975c9ac931
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      io_cesar.hs

+ 2 - 0
io_cesar.hs

@@ -10,6 +10,7 @@ inlinecesar n s = map (chr.(+ ord 'a').(flip mod 26).(+ n).(subtract (ord 'a')).
 
 getCorrectValue::IO Int
 getCorrectValue = do
+	putStrLn "Please give a number in [0, 26["
 	x <- getLine
 	let i = (read x)::Int
 	if i >= 0 && i < 26 then return i else getCorrectValue
@@ -17,6 +18,7 @@ getCorrectValue = do
 main::IO ()
 main = do
 	n <- getCorrectValue
+	putStrLn "Please give a word"
 	s <- getLine
 	putStrLn (cesar n s)
 	putStrLn (inlinecesar n s)