Cov txheej txheem:

Kev Sib Txuas Los Ntawm Cov Kab Mob hauv Twine Nrog Qab Zib Qab Zib: 10 Cov Kauj Ruam
Kev Sib Txuas Los Ntawm Cov Kab Mob hauv Twine Nrog Qab Zib Qab Zib: 10 Cov Kauj Ruam

Video: Kev Sib Txuas Los Ntawm Cov Kab Mob hauv Twine Nrog Qab Zib Qab Zib: 10 Cov Kauj Ruam

Video: Kev Sib Txuas Los Ntawm Cov Kab Mob hauv Twine Nrog Qab Zib Qab Zib: 10 Cov Kauj Ruam
Video: Providing Culturally Relevant Crisis Services (3): Cultural Responsive Factors for Hmong Population 2024, Kaum ib hlis
Anonim
Kev Sib Txuas Los Ntawm Cov Kab Mob hauv Twine Nrog Qab Zib
Kev Sib Txuas Los Ntawm Cov Kab Mob hauv Twine Nrog Qab Zib

Kuv zoo siab koj tau koom nrog kuv dua! Qhov no txhais tau tias Wumpus tseem tsis tau noj koj. Zoo!

Rau cov ntawm koj uas tsis tau paub dua, qhov no yog txheej ntawm cov lus qhia uas kuv tau ua los pab kuv qhov ntxim hlub oochy-skootchy widdle npawg nrog nws txoj haujlwm laus. Cov kev qhia no yog lub ntsiab lus los ua qhov koj tuaj yeem ua nrog qee qhov kev ua haujlwm ntawm Twine thiab Sugarcube. Yog tias koj xav ua raws, koj tuaj yeem pom thawj qhov kev qhia ntawm no.

Hauv qhov kev qhia zaum kawg, Kuv tau tsim chav me me uas cov neeg ua si tuaj yeem tshawb nrhiav. Kuv ntxiv qhov khoom Wumpus, thiab ua qee qhov chav dav dav los hloov qhov uas tau tshwm sim hauv txhua chav nyob ntawm seb Wumpus nyob qhov twg.

Kauj ruam 1: Tsim Koj Tus Neeg Ua Si

Tsim Koj Tus Neeg Ua Si
Tsim Koj Tus Neeg Ua Si

Cov kauj ruam no yooj yim heev. Qhov tseem ceeb Kuv tsuas yog siv tib tus lej zoo li kuv $ wumpus, tab sis nrog $ player sib txawv.

Kauj Ruam 2: Txoj Cai Tshiab Hauv Chav

Tshiab Room Code
Tshiab Room Code

Hloov koj li kev cai hauv chav nyob yog li tus nqi ntawm $ player yog chav tam sim no. Tom qab ntawd sib piv $ wumpus rau $ player hloov chaw tam sim no.

Qhov no yog qhov hloov pauv me me, thiab tsis tas yuav tsum tau ua tiav, tab sis kuv nyiam khaws kuv li kev cai.

Kauj Ruam 3: Tsim Qhov Txuas Los Ntawm Qhov Hloov Pauv

Tsim Ib Qhov Txuas Los Ntawm Qhov Hloov Pauv
Tsim Ib Qhov Txuas Los Ntawm Qhov Hloov Pauv

Thaum kawg, xav hloov qhov txuas hauv kuv chav pib mus rau ib qho uas hloov pauv raws li tus nqi ntawm $ player. Qhov no tuaj yeem ua tiav nrog "" ua haujlwm hauv Sugarcube. Koj tuaj yeem nyeem ntxiv txog qhov ntawd hauv Sugarcube cov nplooj ntawv.

Thawj txoj hlua tom qab peb hais kom ua yog kab lus uas yuav tshwm nyob hauv peb kab lus. Qhov thib ob yog lub npe ntawm kab lus peb xav txuas rau. Kuv siv "Hunt the Wumpus!" raws li kuv kab lus, tab sis peb tuaj yeem siv peb qhov sib txawv nyob ntawd hloov yog tias peb xav kom cov neeg ua si paub qhov chaw lawv mus ua ntej, zoo li no:

Kauj Ruam 4: Xeem

Xeem
Xeem
Xeem
Xeem

Thaum koj sim koj tus lej, koj yuav tsum pom tias koj qhov txuas tau raug hloov nrog kab lus dab tsi koj tau sau ua ntej. Nyem nws yuav coj koj mus rau chav Random hauv koj qhov kev ua si.

Hmoov tsis zoo, qhov no tseem tuaj yeem coj koj ncaj qha mus rau chav Wumpus! Qhov ntawd tsis muaj teeb meem ntau tam sim no, tab sis hauv qhov kev ua si tiag tiag uas yuav yog kev ua si tam sim. Peb yuav tsum kho qhov ntawd.

Kauj Ruam 5: Ntxiv Daim Ntawv Teev Npe Chav

Ntxiv Chav Sau
Ntxiv Chav Sau

Ua ntej tshaj, peb yuav tsim cov npe chav, txhawm rau tswj cov chav yooj yim dua. Los ntawm kev tshaj tawm cov kab no, peb tuaj yeem siv nws los teeb tsa peb $ player thiab $ wumpus qhov tseem ceeb yam tsis tau rov ua dua cov cai. Nws kuj muaj lwm qhov kom zoo dua uas peb yuav tshawb nrhiav tom ntej.

Kev sim nrog cov cai no yuav tsum coj zoo ib yam li nws tau ua dhau los.

Kauj Ruam 6: Tshem Tawm Chav

Tshem Cov Chav
Tshem Cov Chav

Kuv tau ntxiv ib kab ntawm cov cai rau cov cai los ntawm ua ntej (tau hais tseg).

Arrays hauv Sugarcube muaj qhov ua haujlwm uas tso cai rau koj rho tawm cov ntsiab lus los ntawm lawv los ntawm lub npe. Hauv qhov no, thaum peb muab $ wumpus ib chav, peb tuaj yeem tshem tawm chav ntawd los ntawm peb cov npe $ chav. Txawm li cas los xij, txoj haujlwm no yog qhov tseeb. Nws yuav tsis ua haujlwm tshwj tsis yog qhov kev tso tawm ntawm txoj haujlwm tau muab lossis siv qee txoj hauv kev. Txhawm rau saib xyuas qhov ntawd, Kuv tau tsim qhov hloov pauv ib ntus _temp.

Hauv Sugarcube, qhov hloov pauv ib ntus pib nrog tus lej qis (_) tsis yog daus las ($). Lawv muaj txiaj ntsig vim tias lawv tau tshem tawm thaum cov ntawv hla mus, yog li koj tsis tas yuav txhawj xeeb txog cov npe sib txawv.

Kuv tabtom tshem tawm $ chav chav ua si los ntawm $ chav nyob ib yam nkaus, ib yam nkaus li qhov teeb meem.

Kauj Ruam 7: Xeem

Kev Xeem
Kev Xeem
Kev Xeem
Kev Xeem

Thaum peb tuaj yeem khiav cov cai raws li nws yog tam sim no, uas yuav tsis yog qhov kev sim ua tib zoo. Yog tias peb khiav cov cai thiab pom tias $ player thiab $ wumpus raug xa mus rau chav sib txawv, peb tsis paub yog tias vim tias txoj cai ua haujlwm, lossis yog nws tsuas yog lub sijhawm. Tseeb, peb tuaj yeem siv txoj cai ntau zaus, thiab xav tias yog nws tsis tau muab ob qho tib si rau hauv ib chav uas nws yeej tsis ua, tab sis qhov ntawd yuav siv tas mus li thiab nws tseem tsis yog 100% kev lees paub tias nws tsis tuaj yeem tshwm sim.

Hloov chaw, peb xav tau txoj hauv kev los tshuaj xyuas.

Kuv tau ntxiv peb kab rau saum peb kab lus qhia uas yuav qhia rau peb pom qhov tseem ceeb ntawm peb $ wumpus, $ player, thiab $ roomlist variables. Vim yog txoj hauv kev peb teeb tsa peb cov cai, peb paub tias chav $ wumpus thiab $ player chav yuav tsum raug tshem tawm ntawm $ chav npe.

Thaum peb ua raws txoj cai no, peb tuaj yeem tshawb xyuas kom paub tseeb tias yog li cas.

Kauj Ruam 8: Qhov txawv nrog Qab Zib Qab Zib thiab Cov Khoom

Qhov txawv nrog Qab Zib Qab Zib thiab Cov Khoom
Qhov txawv nrog Qab Zib Qab Zib thiab Cov Khoom
Qhov txawv nrog Qab Zib Qab Zib thiab Cov Khoom
Qhov txawv nrog Qab Zib Qab Zib thiab Cov Khoom
Qhov txawv nrog Qab Zib Qab Zib thiab Cov Khoom
Qhov txawv nrog Qab Zib Qab Zib thiab Cov Khoom

Cov khoom qab zib qab zib yog qhov txawv me ntsis. Cia kuv qhia qhov no.

Thaum kuv tab tom tsim txoj haujlwm no thaum xub thawj, kuv xav khaws kuv li $ sau rau hauv ib chav $ saveroom ua ntej kuv pib rho tawm chav los ntawm nws. Kuv xav tias nws yuav tshwm sim tom qab.

Thaum kuv tau txais qee tus cwj pwm coj txawv txawv los ntawm cov cai no, Kuv tau ntxiv lwm kab rau kuv nplooj intro kom kuv saib kuv li $ saveroom sib txawv (daim duab thib ob).

Kuv xav tsis thoob thaum pom tias cov ntsiab lus uas kuv tau tshem tawm ntawm $ cov npe hauv chav kuj tau raug tshem tawm ntawm kuv cov npe khaws tseg! Koj tuaj yeem pom qhov no hauv kev nqis tes hauv daim duab thib peb.

Qhov no vim tias thaum koj theej cov kab zoo li no, koj tsis tau qhia Twine kom luam theej tawm, koj tab tom qhia Twine tias ob qhov kev hloov pauv no yog tib qho array. Thaum koj ua qee yam rau kab lus siv ib qhov sib txawv, nws hloov tib cov kab uas lwm qhov sib txawv tab tom saib!

Peb tuaj yeem kho qhov no nrog clone () muaj nuj nqi.

Kauj Ruam 9: Clone () Muaj nuj nqi

Clone () Muaj nuj nqi
Clone () Muaj nuj nqi
Clone () Muaj nuj nqi
Clone () Muaj nuj nqi

Koj tuaj yeem nyeem txog clone () ua haujlwm ntawm nplooj ntawv Sugarcube.

Daim ntawv "ntiav" yog qhov peb tau ua dhau los. Hloov chaw ntawm ua tiav daim ntawv theej ntawm tag nrho cov array, nws tsuas yog kwv yees tias koj qhov sib txawv ua haujlwm nrog tib qho array. Hloov chaw ntawm daim ntawv ntiav, clone () ua daim ntawv "tob", uas coj zoo li koj xav tau. Txhua lub ntsiab lus ntawm cov kab ntawv tau theej rau hauv cov kab tshiab, thiab sib cais los ntawm qhov qub.

Yog tias peb sim cov cai tshiab no, peb pom tias nws ua haujlwm raws li qhov xav tau.

Tau kawg, nws tsis muaj teeb meem txawm tias koj khaws $ chav nyob lossis tsis yog. Rau lub hom phiaj ntawm kuv qhov project, kuv yuav tsis mus. Nov yog txhua yam tsuas yog ua kom pom qhov sib piv tob tob.

Kauj ruam 10: Nov Yog Tam Sim No

Qhov ntawd yog tam sim no!
Qhov ntawd yog tam sim no!

Peb tau ntxiv cov cai uas cia peb cov neeg ua si pib hauv chav random. Ntxiv rau qhov ntawd, peb tau tshem tawm cov kab uas cov neeg ua si yuav pib hauv tib chav li Wumpus.

Peb tau kawm paub yuav tsim kev sib txuas los ntawm cov hloov pauv li cas, thiab yuav ua li cas cov ntawv theej raug kho los ntawm Sugarcube.

Tej yam tab tom nce, tab sis peb nyuam qhuav pib!

Zoo siab tua tsiaj!

Pom zoo: