我可以使用image1
,image2
.... n重命名下载的附件。
但它只显示blank file
,并使用名称重命名...但如何提供扩展程序以显示附件?
我正在使用rename
函数,该函数适用于我的代码,
我将如何添加扩展程序?
rename($image, $all);
(使用上述名称重命名下载的文件)
答案 0 :(得分:0)
尝试扩展您的名字:
rename($image, $newtname.'.jpeg')
或
rename($image, $newtname.'.png')
等
答案 1 :(得分:0)
尝试
game = do
putStrLn "Welcome to the game"
putStrLn "Press one to start"
n1<- getLine
let x1 = read n1::Int
if(x1==1) then
putStrLn"DESCRIPTION: Write level 1 and Guess the Country's name"
else
putStrLn"exit"
level 1= do
putStrLn "It was discovered by columbus"
ans1<- getLine
if ans1=="america" then
putStrLn "***CONGRATULATIONS***\n You've achieved 5 coins\n to move to next question write question2"
else
putStrLn"Your answer is wrong\n***GAMEOVER***\nto try again write level 1"
question2= do
putStrLn "It is very famous for football"
ans1<- getLine
if ans1=="spain" then
putStrLn "***CONGRATULATIONS***\n You've achieved 5 coins\n to move to next question write question3"
else
putStrLn"Your answer is wrong\n***GAMEOVER***\nto try again write question2"
question3 = do
putStrLn "It is the largest country of the world"
ans1<- getLine
if ans1=="russia" then
putStrLn "***CONGRATULATIONS***\n You've achieved 5 coins\n to move to next question write question4"
else
putStrLn"Your answer is wrong\n***GAMEOVER***\nto try again write question3"
question4 =do
putStrLn "It has a maple leaf on its flag"
ans1<- getLine
if ans1=="canada" then
putStrLn "***CONGRATULATIONS***\n You've achieved 5 coins\n to move to next question write question5"
else
putStrLn"Your answer is wrong\n***GAMEOVER***\nto try again write question4"
question5 = do
putStrLn "It's capital is RIO DE JANEIRO"
ans1<- getLine
if ans1=="brazil" then
putStrLn "***CONGRATULATIONS***\n You've achieved 5 coins\n to move to next level write level2"
else
putStrLn"Your answer is wrong\n***GAMEOVER***\nto try again write question5"
level2= do
putStrLn"In this level you have to guess the countries capital \nwhats the capitol of china"
ans1<- getLine
if ans1=="bejing" then
putStrLn "***CONGRATULATIONS***\n You've achieved 10 coins\n to move to next quest"`