Cov txheej txheem:

Kev Kawm Txuj Ci: 7 Kauj Ruam
Kev Kawm Txuj Ci: 7 Kauj Ruam

Video: Kev Kawm Txuj Ci: 7 Kauj Ruam

Video: Kev Kawm Txuj Ci: 7 Kauj Ruam
Video: Nraug txuj kev hlub 2024, Hlis ntuj nqeg
Anonim
BASIC Programming
BASIC Programming

Nyob zoo! Kuv yuav qhia koj hnub no yuav ua haujlwm li cas hauv BASIC. (BASIC = Beginner's All-Purpose Symbolic Instruction Code)

Kauj Ruam 1: Yuav Ua Li Cas Thiaj Tau Txais BASIC-256

Yuav ua li cas thiaj tau txais BASIC-256
Yuav ua li cas thiaj tau txais BASIC-256

Koj tuaj yeem rub nws ntawm no: Windowshttps://downloads.sourceforge.net/kidbasic/basic256-0_9_2.zipSource codehttps://downloads.sourceforge.net/kidbasic/basic256-0.9.2.tar.gzUbuntu Linux ua kom ntseeg tau tias txhua daim ntawv thov raug tshawb pom rau theem pib -256 thiab nruab nws. (saib daim duab)

Kauj Ruam 2: Ntawv 1 - Nyob Zoo, Ntiaj Teb

Text 1 - Nyob zoo, Ntiaj Teb!
Text 1 - Nyob zoo, Ntiaj Teb!

Pib BASIC-256 (rau Ubuntu cov neeg siv: Nws nyob hauv Cov Ntawv Thov / Kev Kawm. Tam sim no nkag mus rau lub qhov rai program: clgclsprint "Nyob zoo, ntiaj teb!" Thiab khiav qhov program. Output: Nyob zoo, ntiaj teb!

Kauj Ruam 3: Ntawv 2 - Lej

Txoj haujlwm tshiab: clgclsprint "1 + 3" print 1 + 3print "7 - 5" print 7 - 5print "9 * 7" print 9 * 7print "5 /4" print 1 /1 Thiab cov zis: 1 + 347 - 529 * 7635 / 41Rule: Qhov "print" hais kom sau cov lus raws nraim thaum nws tau muab ntim rau hauv "cov lus hais tawm". Yog tsis yog, koj tuaj yeem ua lej nrog cov lej thiab cov lej sib txawv.

Kauj Ruam 4: Duab 1 - Vajvoog

Duab 1 - Vajvoog!
Duab 1 - Vajvoog!

Tam sim no ntxiv rau qhov pib ntawm txoj cai: nrawm cov duab thiab mus rau qhov kawg: xim dub ncig 145, 145, 145 rov ua dua tshiab kom nws zoo li qhov no: fastgraphicsclgclsprint "Nyob zoo, ntiaj teb!" Xim dub ncig 145, 145, 145 refreshRun nws, thiab koj pom lub voj voog loj hauv lub qhov rais duab.

Kauj Ruam 5: Duab 2 - Duab plaub

Hloov "lub voj voog 145, 145, 145" nrog "rect 0, 0, 290, 290" Thiab koj pom dab tsi? Ib lub xwmfab hloov lub voj voog!

Kauj Ruam 6: Duab 3 - Txhua Xim …

dawb dubreddarkredgreendarkgreenbluedarkbluecyandarkcyanpurpledarkpurpleyellowdarkyelloworangedarkorangegraydarkgrayclear "ntshiab" tsis yog xim tiag tiag. Koj tuaj yeem lwv lwm cov xim nrog nws. Yuav sim nws! Hloov "xim dub" hauv qhov haujlwm nrog "xim xiav", piv txwv.

Kauj ruam 7: Ua tiav

Qhov ntawd yog tam sim no. Kuv yuav ua tus qhia thib ob kom sai li sai tau.

Pom zoo: