Cov txheej txheem:

Qhov Kev Pab Ntxiv Yooj Yim hauv Shakespeare Programming Language: 18 Kauj Ruam
Qhov Kev Pab Ntxiv Yooj Yim hauv Shakespeare Programming Language: 18 Kauj Ruam

Video: Qhov Kev Pab Ntxiv Yooj Yim hauv Shakespeare Programming Language: 18 Kauj Ruam

Video: Qhov Kev Pab Ntxiv Yooj Yim hauv Shakespeare Programming Language: 18 Kauj Ruam
Video: LOKY -Txhob Ua Yog Toog (Official MV )Hmong New Song 2024, Kaum ib hlis
Anonim
Qhov Kev Pab Ntxiv Yooj Yim hauv Shakespeare Programming Language
Qhov Kev Pab Ntxiv Yooj Yim hauv Shakespeare Programming Language

Shakespeare Programming Language (SPL) yog ib qho piv txwv ntawm cov lus hais lus esoteric, ib qho uas tej zaum yuav txaus siab kawm paub thiab lom zem siv, tab sis tsis muaj txiaj ntsig tshwj xeeb hauv kev siv lub neej tiag. SPL yog hom lus uas qhov chaws tau nyeem zoo li Shakespearean ua si, nrog cov cim ua tus hloov pauv thiab lawv cov kev sib tham yog tus lej tseeb nws tus kheej. Nws yog ib qho tseem ceeb kom nco ntsoov tias cov lus hloov pauv tau yooj yim, yog li koj tuaj yeem ntxiv cov lus tsis txaus ntseeg, kab lus, thiab kab kev sib tham yam tsis cuam tshuam rau kev ua haujlwm ntawm cov cai. Qhov no tso cai rau kev sau cov cai kom txav mus dhau qhov ua haujlwm thiab mus rau hauv lub ntiaj teb ntawm kev sau kev lom zem yog tias siv sijhawm los ua li ntawd.

Kauj ruam 1: Yuav tsum tau ua

Nws yuav raug kwv yees tias txhua tus neeg sim ua raws cov lus qhia no tau paub txog cov hauv paus ntawm kev ua haujlwm, thiab cov hauv paus ntawm kev mus los ntawm cov ntawv tais ceev tseg hauv Command Prompt. Tam sim no thaum ua haujlwm nrog SPL tus lej, txhawm rau txhawm rau sau thiab khiav koj cov cai nws yuav tsum tau muab txhais ua C thawj siv lub tsev qiv ntawv no, Sam Donow's Shakespeare Compiler. Qhov txuas yuav cia li rub lub tsev qiv ntawv, uas tom qab ntawd yuav tsum tau muab unzipped los siv. Txhawm rau suav koj tus lej, koj yuav tsum tau teeb tsa Python 2 lossis siab dua rau koj lub khoos phis tawj. Yog tias koj tsis muaj Python tam sim no teeb tsa hauv koj lub computer, koj tuaj yeem tau txais nws los ntawm no. Koj tseem tuaj yeem ua raws cov lus qhia no thiab sau koj tus kheej txoj haujlwm yooj yim yam tsis suav koj tus lej.

Kauj Ruam 2: Txoj Haujlwm Ntxiv Yooj Yim

Qhov Kev Pab Ntxiv Yooj Yim
Qhov Kev Pab Ntxiv Yooj Yim

Thawj ntu ntawm cov lus qhia teeb tsa no yog yuav sau cov program yooj yim li cas ntxiv cov lej. Qhov kev zov me nyuam yuav ua haujlwm ntawm kab hais kom ua, thiab tus neeg siv yuav muab ob tus lej thiab tom qab ntawd qhov kev zov me nyuam yuav xa cov khoom ntawm lawv thiab tawm mus.

Kauj Ruam 3: Tsim Cov Ntaub Ntawv

Tsim ib qhov Source File
Tsim ib qhov Source File

Tsim cov ntaub ntawv rau koj qhov program. Rau qhov ua piv txwv no, cov ntaub ntawv yuav raug hu ua addprogram.spl. Txhawm rau ua kom yooj yim, muab cov ntawv no tso rau hauv nplaub tshev spl-master uas muaj cov ntawv splc.py. Qhov no yuav ua kom suav koj cov lej yooj yim dua. Qhib koj cov ntaub ntawv hauv cov ntawv nyeem. Kuv pom zoo Notepad ++.

Kauj Ruam 4: Tsim Lub Npe

Tsim Lub Npe
Tsim Lub Npe

Sau lub npe rau koj qhov kev ua si! Txhua txoj haujlwm sau hauv SPL yuav tsum muaj lub npe. Qhov no tuaj yeem yog txhua yam koj xav tau, tsuav nws xaus nrog lub sijhawm.

Kauj Ruam 5: Qhia Koj Ob Tus Cwj Pwm

Qhia Koj Ob Tus Cwj Pwm
Qhia Koj Ob Tus Cwj Pwm

Qhia koj ob tus cim! Nov yog koj ob qhov sib txawv uas koj yuav siv los ntxiv ua ke. Nco ntsoov, lawv cov npe yuav tsum yog cov cim los ntawm Shakespeare ua si. Nov yog cov npe ntawm txhua tus cim lub npe siv tau. Cov hom ntawv yog tus yam ntxwv lub npe, tus lej cim, tus cim qhia, thiab tom qab ntawd ib ntus. Txog qhov piv txwv no, Kuv tsim ob lub cim, Romeo thiab Juliet. Kev qhia tus yam ntxwv tuaj yeem yog txhua yam uas koj xav tau, xav kom muaj tswv yim zoo!

Kauj Ruam 6: Pib Txoj Cai I

Pib Txoj Cai I
Pib Txoj Cai I

Pib Txoj Cai I. Txhawm rau tsim Txoj Cai, sau "Act", tus lej ua hauv Roman Numerals, cov nyuv, thiab tom qab ntawd lub npe rau txoj cai ua raws lub sijhawm. Qhov no tuaj yeem muaj npe txhua yam uas koj tuaj yeem xav txog.

Kauj Ruam 7: Pib Scene I

Pib Scene I
Pib Scene I

Pib Scene I. Txhawm rau tsim ib qho xwm txheej, sau "Scene", Tus lej Scene hauv Roman Numerals, cov nyuv, thiab tom qab ntawd lub npe tom qab lub sijhawm. Ib zaug ntxiv, koj muaj kev ywj pheej xaiv ib lub npe uas koj xav tau. Nco ntsoov tias hauv qhov piv txwv piv txwv, siv ntau qhov xwm txheej. Rau qhov kev nkag siab ntawm txoj haujlwm no, txhua yam no ua yog pab txhim kho koj li kev cai, thiab koj tuaj yeem sau qhov haujlwm ua haujlwm tau zoo siv ib qho xwm txheej nkaus xwb.

Kauj Ruam 8: Sau Koj Ob Tus Cim

Nkag Mus Rau Koj Ob Tus Cim
Nkag Mus Rau Koj Ob Tus Cim

Sau koj cov cim mus rau theem! Txhawm rau nkag mus rau koj ob tus cim rau qhov xwm txheej, sau "[Nkag mus rau NAME1 thiab NAME2]", qhov twg NAME1 thiab NAME2 yog cov npe ntawm ob tus cim koj xav nkag mus rau hauv qhov xwm txheej.

Kauj Ruam 9: Sau cov lus hais tawm

Sau cov nqe lus hais tawm
Sau cov nqe lus hais tawm

Sau cov nqe lus hais tawm rau koj ob tus cim kom lawv muab rau cov neeg siv xaiv qhov tseem ceeb. Muaj tus cwj pwm hais lus hauv SPL yog ib qho yooj yim xws li sau lub npe tus yam ntxwv, tom qab ntawd los ntawm cov nyuv, thiab tom qab ntawd ua kab lus kom raug. Txhawm rau kom koj tus yam ntxwv lees txais tus neeg siv tshwj xeeb tus nqi, koj yuav tsum ua rau koj tus cwj pwm hais "Mloog koj lub siab." Qhov no tso cai rau tus neeg siv nkag mus rau tus nqi los ntawm kab hais kom ua, uas tom qab ntawd yuav muab rau tus ua cim hais lus kab.

Kauj Ruam 10: Ntxiv Qhov Muaj Nqis Ua Ke

Ntxiv qhov tseem ceeb ua ke
Ntxiv qhov tseem ceeb ua ke

Ntxiv qhov tseem ceeb khaws cia hauv koj ob lub cim ua ke. Txhawm rau teeb tsa tus cwj pwm hais lus rau tus nqi ntawm nws tus kheej thiab tus yam ntxwv tawm tsam hauv qhov xwm txheej, koj tuaj yeem sau "Kuv yog tus lej ntawm koj thiab kuv". Yog tias koj xav kom lwm tus ua cim coj tus nqi ntawm qhov ua piv txwv ntawm ob tus cim, koj tuaj yeem hais qee yam xws li "Tam sim no koj yog tus lej ntawm koj tus kheej thiab kuv."

Kauj Ruam 11: Luam Tus Nqi

Luam Tus Nqi
Luam Tus Nqi

Luam koj tus nqi ntxiv. Txhawm rau kom muaj tus cwj pwm tso lawv cov txiaj ntsig rau hauv cov qauv tso tawm, koj yuav tsum muaj lwm tus ua cim hauv qhov xwm txheej qhia lawv kom "Qhib koj lub siab." Nco ntsoov tias koj tab tom qhia tus cwj pwm zoo kom tso lawv cov txiaj ntsig. Yog tias koj suav qhov tseem ceeb rau hauv ib tus ua cim, lwm tus ua cim hauv qhov xwm txheej yuav tsum yog tus uas hais tias "Qhib koj lub siab."

Kauj Ruam 12: Tawm Cov Cim Los Ntawm Theem

Tawm Cov Cim Los Ntawm Qib
Tawm Cov Cim Los Ntawm Qib

Tawm koj cov cim los ntawm theem. Koj tuaj yeem ua qhov no los ntawm kev hais tias "[Tawm NAME1 thiab NAME2]", lossis koj tsuas tuaj yeem hais "[Exeunt]", uas cia li tawm txhua tus cim nyob rau theem.

Kauj Ruam 13: Ua tsaug

Nrog koj zoo siab! Tam sim no koj tau sau ib qho kev qhia ntxiv hauv Shakespeare Programming Language. Cov kauj ruam tom ntej yog sau koj cov cai.

Kauj Ruam 14: Sau koj Txoj Haujlwm Rau Hauv C Code

Txhawm rau suav koj tus lej SPL rau hauv C, koj yuav tsum tau teeb tsa Python 2 lossis tshiab dua thiab yuav tsum tau rub tawm Sam Donow's Shakepeare Compiler.

Copyright © 2014-2015 Sam Donow [email protected] [email protected]

Kauj Ruam 15: Qhib Command Prompt thiab Taw rau Code Directory

Qhib Command Prompt thiab mus rau Code Directory
Qhib Command Prompt thiab mus rau Code Directory

Qhib Command Prompt, thiab mus rau koj lub nplaub tshev uas muaj cov cai koj nyuam qhuav sau thiab cov ntaub ntawv splc.py. Yog tias koj tsis paub yuav ua li cas los ntawm kab hais kom ua, ntawm no yog cov lus qhia yooj yim kom koj pib.

Kauj Ruam 16: Khiav Splc.py thiab Sau Koj Cov Cai

Khiav Splc.py thiab Sau Koj Cov Cai
Khiav Splc.py thiab Sau Koj Cov Cai

Hauv qhov hais kom ua, sau "py splc.py yourprogramname.spl> yourprogramname.c" hloov 'yourprogramname' nrog lub npe ntawm koj cov ntaub ntawv.

Kauj Ruam 17: Pab kev zoo siab thiab cov lus qhia daws teeb meem

Nrog koj zoo siab! Tam sim no koj yuav tsum muaj cov lus txhais ntawm koj qhov program hauv C code! Yog tias muaj qhov yuam kev, sim rov qab mus rau koj qhov chaw.spl cov ntaub ntawv thiab saib rau qhov ua yuam kev nrog cov cim sau tseg. Nco tseg tias tsuas yog lub sijhawm siv txoj hnyuv laus tuaj yeem ua tus cwj pwm hais lus kab; nws tsis tuaj yeem siv hauv kab lus hais los ntawm tus yam ntxwv. Tsis tas li nco ntsoov tias koj cov cim raug nkag mus rau qhov xwm txheej uas lawv hais hauv, thiab tias lawv cov npe raug sau kom raug. Nco ntsoov tias Kev Ua Haujlwm thiab Scenes yuav tsum muaj nyob rau hauv, pib txij 1 mus rau tom ntej.

Kauj Ruam 18: Muaj Kev Lom Zem Nrog Nws (Yeem Xaiv)

Muaj Kev Lom Zem Nrog Nws (Yeem Xaiv)
Muaj Kev Lom Zem Nrog Nws (Yeem Xaiv)

Thaum nyeem qhov chaws ntawm addprogram.spl, nws muaj tus qauv ntawm Shakespearean ua si tab sis nws tsis nyeem zoo ib yam. Cov piv txwv saum toj no muaj qhov ua haujlwm tau zoo ib yam, tab sis ntau dua nyob rau hauv tus ntsuj plig ntawm kev ua si tiag tiag, nrog qee qhov zoo li ntawm zaj dab neeg. Koj tuaj yeem xav dawb los ua kom zoo nkauj koj cov haujlwm tam sim no kom ua rau nws lom zem dua, lossis koj tsuas tuaj yeem tso nws tam sim no. Qhov kev xaiv yog koj li, nws ua haujlwm zoo ib yam

Pom zoo: