竞争无处不在,青春永不言败!专业撸代码,副业修bug

Talk is cheap , show me the code!



看到微博上有个歪果仁说的一个公式算年龄的,写成批处理玩一玩

@echo off
color 9f
title Game by Frank
::mod col=80
setlocal enabledelayedexpansion
echo This game is to get your age according to the entered number.
set /p FirstNumber=Please enter the first number that you have thought already :
set /a Result=(2*%FirstNumber%+5)*50
::echo !Result!
set /p BirFlag=Whether your birthday has been already passed or not? (Y/N) :
IF /i %BirFlag%=="Y" (set /a Result=!Result!+1766) ELSE (set /a Result=!Result!+1765)

set /p DOB=Please enter your birthday (yyyy) :
set /a Result=!Result!-%DOB%
set /a FirstNumber=!Result!/100
set /a Age =!Result!%%100
::echo !Result!
echo The number you chose : !FirstNumber!
echo And your age : !Age!
::echo on
::FOR /l %%i in (1,1,3) do (@echo )
echo %0 Thank you for running this game, and enjoy yourself^^!
pause>nul

 

结果如图:

posted @ 2016-05-25 16:14  云雾散人  阅读(193)  评论(0编辑  收藏  举报

Your attitude not your aptitude will determine your altitude!

如果有来生,一个人去远行,看不同的风景,感受生命的活力!