Nextneedstoequalindexpluscount, andthen I cansimplysaynumbersnextequalstrue, becausethat's now a spotthat I'velandedonandthesequence I canaddtoit, thevalueNextandthen I couldsayIndexequalsnext.
Solet's dothisfor.
Andactuallyletmeforgetaboutdrawfor a second.
Let's seeifthisalgorithmworks.
What's a fourletter?
I equalszeroeyes.
Listen, 10 I plusplusstep.
Let's justdothis 10 timesandthensayconsoledotlog.
I'm sure I'vemade a mistake.
Thesequence.
Sothisismyideaforthehour.
Thenwetrytogobackwards.
Ifthatis a negativenumber, it's nogood.
Orifit's a placethat's alreadybeenlandedon, then I needtogoforwards.
I needtosettheforwardspottobetrue.
Andaddthattothesequence.
Andnowthat's mynewmynextspot.
So I supposeinadditiontosayingnumbers, Indexiszero.
Technically, thefirstnumber.
That's thequestion.
Zeroisthefirstnumber, So I alsowanttosay a sequencedotpushindexinsetup.
Solet's runthis a code.
And C, Isthisthesequence?
No, no, noNo, no, no, no, no.
Thatisdefinitelywrong.
I couldseeinthechat.
Somepresentcountdidn't increments.
So I forgot a reallycrucialstep, right?
Thewholepointofthisis I goforwardones.
Then I triedthatandtwice, thenthreetimesinfourtimestryingtogobackwards.
Sothis I thinkthisisalreadysomewhatinterestingthatyoucanseethispatternthat's emergingjustfromvisualizingtherecommendsequenceon a numberlinebetweenzeroand 600.
If I gotsomethingwrong, I'm surewe'llhearaboutitinthecomments.
Pleaseletmeknow.
Allright, sothisprobablyshouldbetheendofthevideo, and I shouldbenowgivingyousomeexercises, but I Soyoushouldpauserightnowandtrysomethingifyou'refollowingalongCooch.
Theendcouldbethisis a littlebitthiskindofworkbyaccident, Butthisshouldreallybeabsolutevalue, right, Becausetheendcouldbebeforethestartofthiswouldbe a negativenumber.
I think p fivedoesn't reallycare.
It's likenegativediameteristhesameas a positivediameter.
Butthat's probablybetterformetoputthisinhere.
Andthen I'm justgoingtosayifdirectionequalzerohavethedirectionbezeroorone X isalsothisdotendplusthisdotstartdividedbytwoonandsothisshouldbegoodnow.
Andsowhat I wanttodohereiscreate a arkbetweenindexandnextwiththedirection.
Thatiswhat I say.
Countmoduleistoo.
Okay, sothisiswhat I wanttocreate.
I wanttosayarcspush a Andthenindraw, I cannowsetthebackgroundindraw, and I'm justgoingtosayfour.
Letofallthearcs, I'lljustcallit a ofarcs a dotshow.
Sothisyou'rebeing I didthiskindofquickly, butbasicallywhat I didis I justtookthedrawingcodethat I wasdoing, kindoflikeliveasthealbumofgoing.
And I encapsulatetheideaofdrawingoneofthesearcsinanobject, andthen I buildup a bigarrayofthem.
Sonow I havethisbigarray, andeverytimethroughdraw, I wanttodraweverythinginthatarray.
AndthisisgonnaallowprobablyyouifOkay, directionisnottofind, Umthishastobe, asalways, I alwaysforgetthatthiswasnotthecenter, but I forgotthevista, obviously.
Allright, sothisshouldbeexactlywhatwehadbefore.
Buthere's thething.
Now, thisisactuallyananimation.
Soletmetrysomething.
What?
I havethisidea, whichis I wanttoactuallyscalescalethevisualizationaccordingtohowfar I aminthesequence.
So, forexample, what I'm goingtodonowis I'm actually I thinkitmighthelptodrawtheark.
Everythingcenteredaroundthetheleftsideofthescreen, so I'm gonnadrawtheark.