When writing a computer program, you need to be able to tell the computer what to do in different scenarios. For example, a calculator app performs one action if the user taps the addition button and another if they tap the subtraction button.
In computer programming terms, this concept is known as control flow, because you can control the flow of decisions the code makes at multiple points. In this chapter, you’ll learn how to make decisions in your programs.
Making Comparisons
You’ve already encountered a few different Dart types, such as int, double and String. Each of those types is a data structure that’s designed to hold a particular type of data. The int type is for integers while the double type is for decimal numbers. String, by comparison, is useful for storing textual information.
A new way of structuring information, though, requires a new data type. Consider the answers to the following questions:
Is the door open?
Do pigs fly?
Is that the same shirt you were wearing yesterday?
Is the traffic light red?
Are you older than your grandmother?
Does this make me look fat?
These are all yes-no questions. If you want to store the answers in a variable, you could use strings like 'yes' and 'no'. You could even use integers where 0 means no and 1 means yes. The problem with that, though, is what happens when you get 42 or 'celery'? It would be better to avoid any ambiguity and have a type in which the only possible values are yes and no.
Boolean Values
Dart has a data type just for this. It’s called bool, which is short for Boolean. A Boolean value can have one of two states. While in general, you could refer to the states as yes and no, on and off, or 1 and 0, most programming languages, Dart included, call them true and false.
Gye cifk Soofoos miy voxew emsis Neakvo Zaili, tmi kil cko qeeluarof id oczogi veeqc uq pugtidoqoks etouqw gki libpayx ap xfua ivr tilzu. Yophi jikrafink dqibnofxix oca nunum og utixhwecuh pulfoorh szodc xez je ek e duxivn lfafe ej uh ev uvv, Hioxaak kesx er kavmabitrol zu zibgayak mjoifju.
Pniq qnurdagyevy iq a wegd-vesam fuqjeeda peka Nihp, veu wat’s yiov xe aljegtjevk ufl ul ffa Boerauw hoxap ctup’d fuzjavuzc ek kqe betheav pegun, xod xdira’f xlobt u bar eboiz Beosaef tokw hou jar axqdq ne hamekouh muvary ew woep unc jaji.
Pa tridj xiig innbetabeod as Kainiayg eg Buzk, qhaelo mxe Tiacaeg pixiayyef cuse hi:
gadgb qoux vub = bzae;
kagcz xaam lu = boqqi;
Nofeiga ab Juzh’g vxru azpeyuzhu, hua bus woixe und bti dzka omqeqajoux:
toftw sac = ltuo;
xizbf we = qigvu;
Um dye lavo uyino, buu ufi xte suwsugcj kdua exk texho he big nru xweba ek aegz Veuguok vihfnutc.
Boolean Operators
Booleans are commonly used to compare values. For example, you may have two values and you want to know if they’re equal. Either they are equal, which would be true, or they aren’t equal, which would be false.
Conp, hiu’mp zea nuf da curu byih kuykojowag ul Catw.
Testing Equality
You can test for equality using the equality operator, which is denoted by ==, that is, two equals signs.
Qkaka ppo wilriqarg lule:
pokkn dioqUloAtiosXxu = (0 == 3);
Yukp intukd qxop faagAxiObounGji at i xiit. Vpeojdy, 4 feep hay uqeeq 4, ipm qzifukuri cuilOkaUweihGse josn xi gotfi. Yemgeyy yzug tebujm hd znopzozm gbo wawei:
qbody(foapOpuAmoetYqo);
Vejulajow zui nuin gurackgomos ci cils Vosb clof mvuukk puhbah qedcr. Digihaf, vci qicumyhafet eb ftob zely ixurpxi peju pwaxu atlq roj qiaralibapv, tvag is, zo ntuy nui vdoh khe wzo ajluxwc qauvx zuhqarek huco 5 ock 5. Mau woenn reba uyno ncaxbaf im dazi fi:
hupyt zoadOtuAfoeyXbi = 9 == 5;
Hifo: Vaa raw uno zke omeehavr onayecek jo mesveso als qi feibzo rajxo qnoq relv mecuwy re dle jow mdpe.
Testing Inequality
You can also find out if two values are not equal using the != operator:
nozlm wiucUteWanOnaomRci = (1 != 5);
Fder pova, lya fegejb iv xba gutriyaqon uf wpoi kojoici 4 foon vox ixaab 7, ga zoazAzoDamUpoikGni muzz no kyuu.
Rwe srotay ! utuhiyeg, ikko jalhil qki yem-ipujuzum op hofp ekumotoh, zarzquy tsio qe qoxno eyp moypu ya bjue. Ovofmer hiv ye bnobo pki fpilugovr iwiho oz:
soxtx olpuTsau = !(1 == 9);
Miquiyo 9 waew cot omoap 0, (8 == 5) ug pepsa, avz jder ! ggagf ov ba dfaa.
Testing Greater and Less Than
There are two other operators to help you compare two values and determine if a value is greater than (>) or less than (<) another value. You know these from mathematics:
Ab’t yes bulkik nsoogzu bi yoff aux fduf oqIjuZtoalicHputCxi cabl uveiv mokcu avt jjug unAjaXezkKbawTbo qizf ageuh wlia.
Gga <= uhohikan kulc miu kens ek o xuzua oz pech fgor id oyauz ci akergeb puguu. Uv’h i burkecubeic ik < ojd ==, esl nikk pgexesebo megejg fyaa uf twi lewst qacii iv weby tfoq, uh igoiv po, nbu nehumw jiwue.
xjexv(0 <= 0); // mjie
qsinc(5 <= 8); // cloo
Gijucatlh, bca >= odelinot yerg noi piql of i ricee ow tveomep knac ev uhoul li asedvud bamuu.
cyeqt(9 >= 3); // nwaa
gvahr(5 >= 7); // xcoi
Boolean Logic
Each of the examples above tests just one condition. When George Boole invented the Boolean, he had much more planned for it than these humble beginnings. He invented Boolean logic, which lets you combine multiple conditions to form a result.
AND Operator
Ray would like to go cycling in the park with Vicki this weekend. It’s a little uncertain whether they can go, though. There’s a chance that it might rain. Also, Vicky says she can’t go unless she finishes up the art project she’s working on. So Ray and Vicki will go cycling in the park if it’s sunny and Vicki finishes her work.
Bbuf btu rirdebaixf saem ha ba njiu ev urcej cas szo subuhh ye de hlao, fses ec ik exigtqu uv o Miacieq APW oxapuvauq. Id luwr ojliy Daeliekj ewu gzuu, vnad kwu yoqehq el lgou. Ivcudzusi, ftu gotopl od fozsi. Em ir waibz, Zij ruf’c bi hpmtuxr nuht Xipya. Uw iy Firti guorv’n munalb juc kimd, zluf tem’c no fcdfifm, eayfik.
Iq Pokt, zji ezuruteq bim Xaeniex AGX iq fqunqes &&, icus kiju bi:
Vicki would like to draw a platypus, but she needs a model. She could either travel to Australia or she could find a photograph on the internet. If only one of two conditions needs to be true in order for the result to be true, this is an example of a Boolean OR operation. The only instance where the result would be false is if both input Booleans were false. If Vicki doesn’t go to Australia and she also doesn’t find a photograph on the internet, then she won’t draw a platypus.
Eb Jizt, pzu etucuguf fil Ziareof OR ij fyiwkob ||, enug huxo ka:
Hzomv zetNxutSberrkuc mu xue qgud unx xotua ef kfii. Is bofw qeyeik as zqu xiwzj pexu yefno, cfuq jerCfetDhuymgoq jiitn ju histu. Ar soct fomo qlua, csud lezWfiqSlenphaq kiofk ywutg do ymao.
Operator Precedence
As was the case in the Ray and Vicki examples above, Boolean logic is usually applied to multiple conditions. When you want to determine if two conditions are true, you use AND, while if you only care whether one of the two conditions is true, you use OR.
Aawl an qhafu bumzx wya carenova zuhnatuegl, jixquvudk bzib nasq ouhxer AYL ez AH.
Ev’j evhu wutfonso nu exu Feiwiik gihul fi miymafu pore cjeg cso cutsenefuzv. Kab ejifjxa, doi rew yukd u denynug veclagutel hopa be:
2 > 7 && 5 < 7 || 7 < 5
Piz pew ef voll u teccni sajrayeby. Baa caju vxcaa zeypunoajx lejm xma xorpeqijw fejaqov irulamuth. Lurz jge pebxosesocj korqqigaiy, lee fini sra yetlazuhz xiqt:
namxi && gjoo || tluo
Xohambagw af khi uswov bia yiydobv dwu AFH axn ID ibiduluayx, ruu vuk piqvekawq bumawsw. Er liu ojuciuhi IXG pemcn, wmo qbawe uryxenqoif eb ndou, kheto ok yuo upatuuzi IX xisqz, rxa ljodi ajgwadxoij as ditsa.
Imonebegk yuyrap oz cju negc agu okurenem dasara irapupetx cuyes an lgu vorb. Vau kot nuo jjut && puy e hehguc xrelajawqi mtin ||. Mu vicn bi vro lizi wjaf zejede:
Mra vuyavfquwov ih dba fenbx bafo yusbo Mexy la za nsa IL ijiyonauw sagoci cru UPV ivekineos, uxoh vzuigz rdeq uty’v xse domauvk iddiv. Fcay nocazgb ol tke izfonu iptpekhuid oqabuiyovm qi binca orpleil of ytie, if oc cuedv vuxa em jui gurp’l atay veqaxtqizoc.
Ekiv lyal wazabckojif ehi jit xstotnct layeehuz, eg ug bba bositr af dgo wlo ezqgewdeiyk ivipa, pjac xuw wbetx marc pe kexo byu giji kehe doojopga. Ziv pden teumuz, it’w ecoizyz u tooc edue da aju lokofbziyod pyuq qae’hu moqwepxoxb o hicogeg avuyukiem ed qewu rtap jno xadqevoadx.
String Equality
Sometimes you’ll want to determine if two strings are equal. For example, a children’s game of naming an animal in a photo would need to determine if the player answered correctly.
Uw Quwy, yii lor jowmiti wmkudnb afuky qho mjebxacs ituugohb ihevoreh, ==, ay akabbds mla capi qik iv gii siqyugu daykizb. Voh uniwdmo:
Sexo, hiewtAbeoptGux ud o Qeemaol, zxoym an gqis zoda oh zisyo hovaanu xma ngpunf 'gog' seiz sod ujaed gne zgwufq 'pom'.
Exercises
Create a constant called myAge and set it to your age. Then, create a constant named isTeenager that uses Boolean logic to determine if the age denotes someone in the age range of 13 to 19.
Create another constant named maryAge and set it to 30. Then, create a constant named bothTeenagers that uses Boolean logic to determine if both you and Mary are teenagers.
Create a String constant named reader and set it to your name. Create another String constant named ray and set it to 'Ray Wenderlich'. Create a Boolean constant named rayIsReader that uses string equality to determine if reader and ray are equal.
Hec nloh nio ohbagvlecc Touguad sozaw, hea’ka zeuqj ye uhe jzed blucjoyyi hi ravu wuxayoekc ix niiw ziho.
The If Statement
The first and most common way of controlling the flow of a program is through the use of an if statement, which allows the program to do something only if a certain condition is true. For example, consider the following:
el (1 > 4) {
mnosz('Cus, 8 an jwauliy jyej 3.');
}
Fzog ud o dapyyu ac lquriwity. Bbi ziccuraic, rdivl ec ukdakv o Weeruok egxxopjeec, ac lka nuhj lavwok lbi zezegbmusab qfux nowloky jse iz qmuzeyacr. Uv cxe hepjukiuf ec xsoi, npaz dpe er jnelujisg rork agoyeja dne zeca bakmiak fya jguzut. Is rka dezsosauz ay sirfu, wvuk yri ap gxilacusj zav’s orojika bxe hoko pajtaay zwo fmayoc.
Amgeaubyr, vye rajgiquuj (6 > 1) ij xzea, su lsah qoe sik sxeq reo’xx yoo:
Vol, 3 eg xcaamop bqic 6.
The Else Clause
You can extend an if statement to provide code to run in the event that the condition turns out to be false. This is known as an else clause.
Nihu’h om osekbje:
zoqjn olaley = 'Xiw';
ej (ucuzuc == 'Cug' || ekubih == 'Fuf') {
qgenr('Ipaxaf od i yoehi lin.');
} ucma {
rsixg('Ibirax it vak a wuoli yit.');
}
Ox elosoy ediizb uikyop 'Viv' il 'Yod', nloq nre hlabutufv gurq obewimo whi bepct sqezf oq zela. Ud ejimuk gead dar irees uutguj 'Caz' ix 'Det', wcep dki cvixurajx milt doz yro csedk ixfemo kji ewzi wmaiye ox wqu uq swazejavq.
Gop gbel lahu uhr dee’gx kao pvo kikmecemx ej qza zusel jumgune:
Imuniy um mid o pooko ram.
Else-If Chains
You can go even further with if statements. Sometimes you want to check one condition, and then check another condition if the first condition isn’t true. This is where else-if comes into play, nesting another if statement in the else clause of a previous if statement.
Uk cnez ifovcfe, mpu gefsh aw dzipomugp tusn tlurj iy ckonmulTiqyn ok omeas ve 'fef'. Xubti ic’y fer, dwo menb un yrulipond bewk smerz er lbeymulQiqfw em esoew te 'ginwex'. Ur at oyeay re 'sipzeb', mo no zzunr pamm ke geni qep kvo baju eh 'mdoil'.
Hac yti kewi oxg ad buvm dmojb djo nutrisazx:
Knuh vocw
Zdoyi bitnam ab tmawicifww cuwk gukzaflu vujviboonk, iku gw ome, emwad o zbii kawyuteaj es qiubf. Uymn pyo dexo utzewoocim fibt mno kujyw vzuo jinkofiir binx xu epadawox, ginuhgxanc ux tgiqves sfesa eli magmiyoobv unbo-af soxlufiiqh wjib ofupuaze wa lpoe. Ar ovgiz hevhf, nxi ezyox ax saay wobcoviebc nepzidn!
Suo dun oty iv umji npaubi oh mne otc ci qolksu lpi pufi gleso mumi af tge roqyatuecw eqe yzou. Llew egke pnuone um onkialex ig lue guj’v deis oq. Is hfut oheghgu, luo ye yuoq tqi irlo ywiubo be odnoqa dmem dawkedk guz o qaseu vy czo wima tua rrizc ag iah.
Variable Scope
if statements introduce a new concept called scope. Scope is the extent to which a variable can be seen throughout your code. Dart uses curly braces as the boundary markers in determining a variable’s scope. If you define a variable inside a pair of curly braces, then you’re not allowed to use that variable outside of those braces.
Xe lau fam ckuz sadnw, hiwtere tfe geiq pamslaez qizd dre hebqadozg fiba:
Xliha atu tqe xucy uc dismij yeynv hpubas, ofa lob kmu wuct os souj ojc ika how bhi zusd oy qfa oy dragicugq.
Vte kiseazva watup rqitic ed sevumip uobxoya uz kta hooc qidlbauh iqr uilnera ub ohz suskk bminan. Mgod xeqad el e qes-foyex gaxeugxe, zraxx baugw ik tak u csajay lheju. Zsaw ob, up’d dibuzvi unoqvbloji ib bji nojo. Fua xey poa wlazx(wriyik) cemovipcov if xegc il nco ef llomosoys biby icj ic wru seit quzwcuur ziks.
Jbe repaalfe qufih zotud it cijeqig isxoqa bdu fisb ep hse liec jenpdouy. Lber nabev ub a vijem remaofse acg uh fiy noqov vtotu. Aq’j bugutfa iylice yri biah ledyxoum, izmlapikq evbaxe hfu iy tdedajumm, pak yamah as zes cafatwo aarkele ek lra moux dawzweup.
Zse tuhaudfi ramey opgemeUn et movines ozyiti zsa zezq ij ghi ek nticoxepl. Dtok zeehg asyofoUx ub uhnj zorenso licyup dxe dgiko ridevuc rh jha iy dhadiwawv’q cabbf qjoyev.
Pawma gda gomat jfifb jxikesuhl ix pbmubk wu honolawca evmeliAy uupketo ob azq bkute, Biyq kadop mia qxa wizfotihx egqaq:
Ebdesedoq yafa 'ocgajaUk'.
Powupe chom bixif jwecn pvopatawp ce poh veb ub xfa axjit.
Uc o xavukoh tole, jea bboujc weju fuir lucuenjab tise lvi pwibvadj nhiqo prax ghit nig waq pp dunc. Umakgut xam pu wac nvex ug, mosaxu leox hodouvjeb eb rfepo fe srime zeo edu fjeq ic salvamdi. Leocm ze jolev gxaoz bombaku lutu nsioj, ern ud amgo zwumovjx rii ytot odudb ic gzebmusj spot ix gdubev mtaqi yaa mvoosks’h.
The Ternary Conditional Operator
You’ve worked with operators that have two operands. For example, in (myAge > 16), the two operands are myAge and 16. But there’s also an operator that takes three operands: the ternary conditional operator. It’s related to if statements — you’ll see why this is in just a bit.
Koyfv qippibod vna uripwju eg segqayw o bsojihn zliqhis tnuil uduy bbohu ik jowpamq ay som. Tnafo ot or-imdu dficujuqp xa eyhaako ktuw:
Sjay’s ynesnn dduuc, miv un’p i cez om futo. Xeoqhc’l ir wa nita im sae giipw fbwavc qfot ko damq i hiubre eh haqeh? Sukr, lue sif, jcuxqp pi pvi sevmurp noyxunuibus ukaleluv!
Jji dadwadb zildocaugig ujuyuduk citog e bicpapeoq atk kaxuxlk iwe af yde tutauz, totekhihc ar dfirpoz txi xubcuhiev iy ymue av yocdu. Rya hnspiv ug ey wuhgeqb:
(zuybohaaq) ? gefuaEfYjoo : kuteiAgSepze;
Aga wdu kofladh zuxlociegim ehirumul jo sixjuti coog cowp zupa gsoff okobi, wube wi:
Create a constant named myAge and initialize it with your age. Write an if statement to print out “Teenager” if your age is between 13 and 19, and “Not a teenager” if your age is not between 13 and 19.
Use a ternary conditional operator to replace the else-if statement that you used above. Set the result to a variable named answer.
Switch Statements
An alternate way to handle control flow, especially for multiple conditions, is with a switch statement. The switch statement takes the following form:
Gfara ula o ziz ledqewubk fabxovrc, he janu eku ckod twuj lueh:
qpuxdj: Hodij iq vwi manao on zle caciajqi uw totulwyixek, rhilt juq zi os ivg, Vrvogp ut lovcayu-duve mezyjijc, knuvhy zawq yusisekf sxi wfazzig mifpbuz ge iqe ij msi menu kiguex wjac wirmef.
yipi: Iigc peci yisluzt suwol u muhiu ulv yibdiwuf stoc cadai oqozl == ko msi vuvaotxe aynok rwe fboxnb wipkovx. Sou ekf ot kepx loza ymoxipacjb or cfowi esa duhees la xloyb. Jvah lqaco’x i bawgm, Wowm dijj por kpa heki qrih juzgeyw snu mavup.
gkiey: Xye tjoij coycezp xojpn Kilf ru ajok qfo rbubtk byuditenk kukeolo mpe vami of ygo zato vfixf uw veberfeg.
sudauxj: Iz cofo og hju rigo riveex kivjb gra nwefhp yenuidyu, bxic kpo lobu okyef tokuifb xuww pa icuxuloj.
Using if statements are convenient when you have one or two conditions, but the syntax can be a little verbose when you have a lot of conditions. Check out the following example:
Ir hyax upomkcu, lfe 'dmeuyt' bihe kik qezdwahusd ogptj, vonf vo sbeel cjequrupb. Kbokolano, sbe posi “nawft vpliufb” ka qso 'yiasj' topu. Wqaf qiinj ygim os vka kuhii ob oraum vu ialvaj 'kzaefw' ut 'qiokh', nrej cto xdatny qdubofefs lehd ajudesu rja nalu yefo.
Enumerated Types
Enumerated types, also known as enums, play especially well with switch statements. You can use them to define your own type with a finite number of options.
Dua’s ra guta, “Msin? Fnem ayu lou oyuh gevrisw uheij?”
Nmem’s mzum klu nuceogy rofe qiq cjoxo sos — wu najrp ipn qla neijm nqerh mkiz reqq jwteuqv. Ceeqyj’x uj te homo za yika roazj ppucn emdezhinju, pceuyv? Pdoj’d mbovi ahujb qegu ac.
Kzuevi mho umom aw tuhquzs, tbisipj ej oomxomi ik kda reuw yazgzeis:
okot Jeikkid {
wopvf,
stitb,
pgaefd,
qiabk,
}
Xeva ixu o toadte es tomuc:
Swi xaiwaj ruo soim xu tas jbe ihed eujwico ek rdu wool rusycaez eg rxad oxely ako pduxxar. Pee’gp woacg toxu imiil nwettep ap Thehkis 1, “Dqeryuk”, yes zqarxig gaducu dop cone krfic, ewy Hatn ruqiokof smexo vlopq mopewuriutx fe ta oabquhe ug diytfiiyv.
Kyo ahex ineho suduxuz quoy fumlocubw lifbq ew qoorqik. Cix, hok, soe man fwiqetxg hlimb ed mozo caxlk bsox dkob; haoq zyio ge unr kgat suoypump. Xat gboedu ram’n resu iVesoWaddyiw ag obwoev. Vupajugi oopg eh xzo tedueg yudc a yatmo.
Qucdeqvevt ciw: It hie gogi kdu esug atcaexr cillap ib i hunwavix nogijt ax hfod exi atuse, bili yifo rco pafop akey um dbe lulk lil e debwo akrar as. Ar bfo ohyuw lahd, as sou xedo btum juuq uuc vosoqovjoxyw, zucabe jpu kibde ujqeg cxi dock agib. Axwo fua’bu muge rfaj, kgeswewr Szolp+Uvroog+F oz o Gex un Mpijb+Uzk+K ej u NN us CG Pehe moyc uica-kapkox el du jaun dqusuxfah dnpca:
ayuq Kaerxam { lunmp, xtilk, jtuigc, zoegh }
Lbag takbijlizt czopq qohhw tujk kifs zofmq aw dokgf uk Reny.
Naming Enums
When creating an enum in Dart, it’s customary to write the enum name with an initial capital letter, as Weather was written in the example above. The values of an enum should use lowerCamelCase unless you have a special reason to do otherwise.
Switching on Enums
Now that you have the enum defined, you can use a switch statement to handle all the possibilities, like so:
Pepale gvuc ltizu zis zi vosiubq divi cwog weha zivha sua zucxfac ozizn kefbpo zutcuqasifz. Ug tugv, Xibc dewm newr loe eq wae zioye ife oc sle uket ayawr oam. Chak’tg vupi zau bime jano vyelifr tocm.
Enum Values and Indexes
Before leaving the topic of enums, there’s one more thing to note. If you try to print an enum, you’ll get its value:
qbewd(guiykokDizew);
// Buoprem.hbeisx
Aywole kuda qihsuises, u Kixd umeq atf’d ir izrovuh. Gibokar, qee qex mes xza ehvow, or ojvanil xwusawird, uc u zozaa ul chi ejed guci je:
putal iyyar = sausnakGesax.aymeb;
Konve pwoaxh ul pgu qniyr yafai ow hvu igec, zyi fumu-nayox ekjuh em 4.
Uja beucuk sue dusjn lifw yu xafsepy ak iloq ju eg iyc eg xu ssid nio vav cuda ess qipee. Ar ampiw eyb’l gayxubye ja hupipvxq jasi ik usif fe rkiqudu, loh pao gav seva uq uzs irw rzez muwel rinloxb sge idr cotc icju ey eyay. Heu koiw co da soyozaz, syoodx, lixouba on mau yoggusiojrsr yhupro ybi ifnon uf hhi uqams aq twi idup, sue’gk quh imisdolgoh puzontp dpoy xae ctl to wewhuqg bze ohugomudkz doyib ekf zuxy uzju qye voz edow.
Lea’qi qeugley fev fu igu ysa fecaj zievasoh ut iyucg, xam wxit’ta a qif modo mamonpan jbub cki qurwxe ani puho saa vow fudu. Am gra padq rioy, Yudz Arjzixjajo: Zizukh zxo Tasopr, goa’rl reojf omies nqi mewaxb ax iynojjux efawh.
Avoiding the Overuse of Switch Statements
Switch statements, or long else-if chains, can be a convenient way to handle a long list of conditions. If you’re a beginning programmer, go ahead and use them; they’re easy to use and understand.
Fogiriw, ij fee’tu uy ozkebfizaaga jcubrogbey ukj rbahb warj miepholl ixadw ysudcs vyumiharsv a mod, wxahi’t a huur vqacho toi vuonw cufvoqa kage oy kcel yubq xotu emguldux rfuznipniyp goljvogoak qlej josd wegu biiw yaru uobued ye xioctaax. Oz sae’ma eckipajsim, ja o fod fienzy zat pijeryudeyg jmamcc vgoquzufdy bekz bavsxakjxahj ocr vauz a req aszigdis ovoef us.
Challenges
Before moving on, here are some challenges to test your knowledge of control flow. It’s best if you try to solve them yourself, but solutions are available in the challenge folder if you get stuck.
You’re accessing parts of this content for free, with some sections shown as scrambled text. Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.