?? caishugame.m
字號:
function canshugame()
clc;
disp('welcome to play guess number game!');
time = input('Input a number(You can setting the max time you want):');
if time > 10
disp('very easy!');
elseif time > 7
disp('it is normal!');
else
disp('very hard!')
end
b = fix(rand(1)*100);
while time > 0
a = input('Please input a number between 0-100: ');
if a > b
disp('the number your input is bigger!');
elseif a<b
disp('the number your input is smaller!');
elseif a==b
disp('You win!');
break;
else
disp('your input is not a number! Please input again!');
time = time + 1;
end
time = time - 1;
end
if time <= 0
disp('Your loss!');
end
reply = input('Do you want to play again? Y/N [Y]: ','s');
if (reply == 'Y')|(reply == 'y')
canshugame();
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -