Nov yog ib txoj hauv kev pub dawb thiab yooj yim los ua video games. Koj kuj tsis tas yuav rub nws. Hauv cov txheej txheem, koj yuav kawm me ntsis txog kev ua haujlwm batch. Koj yuav tsum tau muab koj tus kheej zaj dab neeg los ua qhov kev ua si no.
Kauj ruam
Kauj Ruam 1. Txhua yam hauv kab lus tuaj yeem hloov pauv, nws yuav tsis cuam tshuam rau qhov kev ua si - tsis txhob ntaus nws hauv qhov chaws tiag
Kauj Ruam 2. Qhib Notepad lossis lwm qhov program coder - Geany, Notepad ++, thiab lwm yam
Txuag cov ntaub ntawv nrog lub npe 'Kuv Ua Si'.bat
Kauj Ruam 3. Pib sau cov cai
Pib los ntawm kev ntaus ntawv:
-
@echo tawm
-
title 'Kuv Game'
-
kob 0a
-
yog " %1" neq "" (goto %1)
-
ncua
Kauj Ruam 4. Ntxiv xim
Tam sim no txuag thiab khiav. Qhov kev zov me nyuam yuav cuam tshuam qhov yuam kev thiab sib txawv xim sib xyaw ua ke. Nrhiav cov xim uas koj nyiam thiab ntaus tom qab "xim" hloov "zz". Kev sib xyaw ua ke zoo yog xim 0A, uas ua rau cov ntawv ntsuab thiab keeb kwm yav dhau liab.
Kauj Ruam 5. Tsim Cov Ntawv Qhia
Txhawm rau tsim cov ntawv qhia zaub mov, tshem tawm ntu ncua thiab ntaus:
-
: Ntawv qhia zaub mov
-
cls ua
-
ncho '1. Pib '
-
ncho '2. Qhia '
-
ncho '3. Tawm mus
-
teeb /p teb = 'Sau tus lej uas koj xaiv thiab nias nkag mus.'
-
yog %teb %== 1 goto 'Start_1'
-
yog %teb %== 2 tau txais 'Hint'
-
yog %teb %== 3 goto 'Tawm'
Kauj Ruam 6. Tsim ib qho 'Tawm' thiab 'Hint'
Txhawm rau ua kom lub vijtsam tawm, ntaus cov cai hauv qab no:
-
: 'Tawm mus'
-
echo Ua tsaug rau kev ua si!
-
tawm /b
- Tam sim no rau cov ntawv qhia hint, ntaus:
-
: 'Qhia'
-
cls ua
-
ncha 'Hint'
-
ncha.
- Tom qab ntawd sau:
-
ncha 'Koj hint ntawm no'
- Muaj ntau npaum li koj nyiam, tom qab ntawd ntaus:
-
ncua
-
mus Menu
Kauj Ruam 7. Pib qhov kev ua si
Ntaus hauv qhov xwm txheej:
-
: Pib_1
-
cls ua
-
echo 'Koj tau ntsib tus neeg phem. Lawv cov tub rog yog: '
-
ncha '3 neeg ua liaj ua teb'
-
ncha 'Koj muaj txoj hmoo zoo ntawm kev yeej.'
-
teeb /p teb = 'Koj puas xav sib ntaus lossis khiav?'
-
yog %teb %== 'Sib ntaus' goto 'Sib ntaus_1'
-
yog %teb %== 'Khiav' goto 'Run_1'
Kauj ruam 8.
Sib ntaus thiab khiav.
Tam sim no los tsim kev sib ntaus thiab khiav cov ntawv qhia zaub mov:
-
: Khiav_1
-
cls ua
-
echo koj nyob nyab xeeb!
-
ncua
-
mus 'Start_1'
-
: Sib ntaus_1
-
ncha Koj xaiv los sib ntaus.
-
echo Sib ntaus sib tua pib.
-
teeb /p teb = Ntaus tus lej 1 thiab nias nkag mus ntxiv:
-
yog %teb %== 1 tau txais Bertarung_1_Loop
-
: 'Sib ntaus_1_Loop'
-
teeb /tus lej =%random%
-
yog % num % gtr 4 mus 'Fight_1_Loop'
-
yog % num % lss 1 goto 'Fight_1_Loop'
-
yog %num %== 1 goto 'Lose_Bertarung_1'
-
yog %num %== 2 goto 'Win_Battle_1'
-
yog %num %== 3 goto 'Win_Battle_1'
-
yog %num %== 4 goto 'Win_Battle_1'
-
: 'Poob_Fight_1'
-
cls ua
-
echo Thov txim, koj poob lawm! (
-
ncua
-
mus Menu
-
: 'Yeej_Fight_1'
-
cls ua
-
ncha nrog koj zoo siab, koj yeej!
-
teeb /p teb = 'Koj puas xav khaws nws?'
-
yog %teb %== 'Yog' goto 'Txuag'
-
yog %teb %== 'Tsis yog' tau txais 'Start_2'
-
: 'Txuag'
-
mus 'Start_2'
- Tam sim no koj tuaj yeem rov ua dua txoj cai siv hauv 'Start_1' los tsim qhov thib ob, thib peb, plaub, thiab ntxiv rau.
- Tsis tas li, yog tias koj ntaus piv txwv: Sib ntaus_1 koj yuav tsum nco ntsoov tias ib feem uas hais tias sib ntaus sib tua_1 nyob zoo ib yam li lwm qhov kom yog tias koj hloov ib qho, koj yuav tsum hloov ob qho tib si.
Kaw Notepad, tom qab ntawv nyem yog, txuag cov ntawv. Hloov cov hom ntawv rau txhua cov ntaub ntawv thiab ntxiv.bat tom qab lub npe.
Lub tswv yim
- Nco ntsoov, txhua lub sijhawm koj xav tau qee yam pom rau tus neeg siv, ntaus ncha ua ntej ntawm nws.
- Ua si qhov kev ua si thaum nws tsim txawm tias nws tseem tsis tau tiav. Qhov no yuav pab koj pom kev sib raug zoo ntawm yam koj tau ntaus hauv thiab yam koj tau txais thiab tshawb pom qhov tsis raug.
- Yog tias koj xav tau tawm hauv nruab nrab ntawm qhov kev sim ua si, ntaus Ctrl-C.
- Cov ntaub ntawv ntau hauv Windows tuaj yeem siv rau kev ua haujlwm tsis siv neeg, tab sis sau cov ntawv ua si zoo li no yog txoj hauv kev lom zem kom pom tias nws ua haujlwm li cas.
- Txheeb xyuas tsab ntawv ua tib zoo thiab koj yuav pom qhov twg tsis raug.
- Qhov ua yuam kev ntau heev yog qhov program tsis ua haujlwm.