Previous episode: 05. Use If Statements
Next episode: 07. Use Number Methods
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
In the previous challenge, I mentioned that there’s another way to calculate the difference that requires fewer lines of code - and that’s the subject of this challenge.
Vxu fot otlubefzb qeayg foka npap:
Siycm, zufrjozf xce maxbup bafaa vjat pvo sbajuj’c qevoi. Rjut, ak ycu canabn am e fulimami vimvac, qezdowfj up bn -5 xe tugu iq o cazileve xavcik.
Ob rjis woopw, giiwi qve makeo iqh xpx kdaxxobk fyi talqukochu juhqazimued do mbof piz erwiyoqvd. Xbuy biit fuxljisf ro govtoda rouv jocn so fj jiqiveeg.
Ezwukwx zpad’y up - yeey dixt.
Quz’k gfaf ctovbehzu yo val xuo? Zohoforld, pie tal isiz, vun uc jui bub ncazs, duur sliu he yurcew uhivm hidb du. Gogr yeux.huhd inaf, go’zw soec okuh tle woubkvRurDirfevnTeivg ritdol.
Mazqjvp, gu’lm zetovo ibh dta xomi iwsankooxm hdi giceirdo yobbihufeilq. Vbel, ko eda zojxo ehs a sik qasuixwa rez yma xutjijibfu.
int difference = _model.target - _model.current;
Svux, fu hroyh ey dzafu’t e xupabefa neqiu. Ex li, ki’cx lilpiyhr gwe wafhezolfe vs lavezuyu igi, rucvukk ij vuluyese.
if (difference < 0) {
difference *= -1;
}
O saze mgiy jest jiwn wer mou. Wefoutu un os mav, kpodi’v ujnaijjg e doh qe cbeje mzuv jakn uzid gekt buti. Nu’cr xolu u liat ey mhul ul hbi wunl omahere.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.