Soyoumighthaverecentlyrememberthat I did a challenge.
A codingchallengewhere I attemptedtocreate a logointerpreterlogobeingtheprogramminglanguageinventedin 1967 whereyoucancontrolthislittleturtlethatmovesaroundthescreenandmakegraphics.
And I didmycruddylittleversionofit.
I putwithmybestattemptonmychannel.
Andthenyouthepeoplecreatedsomething.
Unbelievable.
So I'm gonnagotogethubdotcomslashcoatingtrainslash, uh, logo.
YoucanalsoSo, inadditiontocontributingtomaybe a communityversion, ifyou'vemadeyourownversionthat's hostedsomewhereonyourown, youcansubmitthataswell.
So I don't know.
Yeah, youcansee.
Lookatthishere.
I think I showedthesealready, butthereis a three D logoexperimentthatwassubmittedhere, which, actuallylookatthis.
Thisisamazing.
ThatsubmittedbyDavebesoftdotcom, whichimplements a versionoflogowhereyoucanrunit, runitwith a three D render.
Oh, mygoodness.
So, somuchamazingstuff.
Okay.
Um, so I wantedtomentionthatumwhatelseiscoming?
Coming.
So I amgoingtoItisalmostDecember, and I amplanningtodo a holidayextravaganza, butplanningmeand I havenoplanyetonthatwillbe a fundraiserfortheprostatefoundation.
So I justwanttomentionthatyoudon't needtowaitforthefundraiser.
CrossingFoundationis a, umnoneforprofitfoundationintheUnitedStatesThatsupports a varietyofinitiatives.
Thisis, I thinkgonnabeFinally I'm gonnadothisintwopartsbecause I'm gonnado a reallysimpleversionwithjust a trianglefirst, andthen I'm gonnadoanotherversionwith, um, uh, moreof a variety.
Okay.
I'm lookingformytrainwhistle.
Here.
ThisAllright, letmereset.
Almostwannahave a timerhere, butnothingever.
Nothinggoodevercomesfromthetimer.
Okay.
Thevolumewasprettygood.
I wouldn't changeit.
Okay.
Allright.
Hello.
Welcometo a coat.
That's OK.
That's OK.
That's good.
Well, uhcool.
Okay.
Me, me, me, meme, me, me, meByAllright.
Hello.
Welcometo a coatingcodingchallenge.
Lastlastdrylastyear, everybodyHelloandwelcometo a codingchallenge.
TheChaosGamedoll.
Allright, sowhyam I doingthiscodingchallenge?
I recentlywasluckyenoughtoattendthisamazingevent.
ThinkerconinHuntsville, Alabama.
ThankyoutoSmartereveryday.
Andtheotherorganizersofthinkercon.
Thiswasmindblowingevent.
Andatthisevent, I was I hadthechancetodo a livedemoofsomecodinginfrontofpeopleunderneath a rock.
I wasveryluckytoattendthisamazingeventcalledthinkercon.
I'm wearingmy T shirtfrombiggerconThankyoutotheorganizersofThinkerconDestinSandlinfromSmartereveryday, andHenryReichandEmilyGrassleyandSabrinaCruiseandRobertColeridge.
Eventwasmindblowinglyawesomeandamazing.
I metsomanywonderfulpeoplelinkstofingerconandvariousotherYouTubesamplesrelatedinthevideo's description.
Sowhile I wasthere, I metforthefirsttimeinpersonJamesSchloss, whoistheauthorofthealgorithmarchive.
A wonderfulwebsitewithmanysortsofalgorithmsinit.
ReadmoreaboutitalsofromtheYouTubechannelthat I havenoideahowtopronounce.
Still, ButLee I O S O.
S, um, when I'veused a lotofhisvideosbeforeasinspirationandideas.
Okay, soJamesand I did a livecoatingdemoinpersonatthinkerconcreatingthisthechaosgame.
Sowhatisthecasket?
What?
Thecastgame?
Chaosgame.
I havetoexplainwhatitisnow.
No, thatwasThatwasprettygood.
Thatwasprettygood.
Cathgame.
Prettygoodoriginally.
Wait.
Oh, yeah.
Then I havethenumber.
FileVideo?
Yeah.
Thecastgameis a I'm I said I wasn't gonnacry.
Who's nocryingencoding?
Allright.
Thecastgamerefersto a methodofpickingrandompointsandinterestreallymovingpointthepreviouspointYoupicktothenextpoint.
Andyouknowwhat?
There's notreally a goodwayformetoexplainittoyouotherthandiagrammingitandactuallyjustreading a codeforitformorebackgroundonthecastgameandcertainlywouldsuggestthisparticularvideofrom a numberfile.
Sowhat's amazingtobeaboutthecastgame, isit?
There's a very, very, verysimpleidea.
Sothewaywe'regonnaplaytheChaosgameiswearegoingtohave a twodimensionalspace.
Thattwodimensionalspaceisgoingtostartwith a setofseedpoints.
Now I'm goingto, forthemoment, justcreatethreesortoffixedseedpointsintheformof a triangle.
Ofcourse, headingthreepointsorbasicgonnamake a triangle, let's rollononeline.
Butthat's anothertopicforanotherday.
Andthenwhat I'm goingtodois I amjustgoingtopick a randompointanywherethatwassuch a fail.
WhatthirdtryisthecharmThirdcharmsthethird.
Okay, I kindofrandompoint, andnow I'm gonnastartwiththisrain a pointthen.
If I weresomebodywhodidn't codewhat I wouldfityou.
Really?
I I'm havingtroubleisn't theproblem, but I don't livestreamoftenenough.
So I coverthewholething, andthen I wouldmakeit a blackbackground a littlebitover.
I thinkwe'regood.
Allright.
Sowhat I wanttodonowisletmedrawthosepoints, so I'm gonnasaystroketo 55 stroke.
Waiteight.
So I justwanttoseethosepoints X.
I justwanttoseethem.
So, um, weshouldseethreepoints.
Now, howcome I don't seeanypointsbecause I amdrawingthebackgroundoverandoveranddraw.
Solet's dothisyear, Okay?
Soeverytime I runthissketch, I amgoingtonowhavethreenewpoints.
Allright, sonowlet's playthechaosgame.
Sowhat I amthen I need a kindofglobal X y Weneed a global X y.
Andwhat I'm gonnadowiththatis I'm gonnaalsogoingtohave X y besomeotherrandompoint, andwhat I'm goingtodoindrawissay, stroke.
Let's makeitlike a niceRGBcoloron.
I'm gonnadrawappointed X y, andwecouldseeOkay, thereitis.
Sothisisright.
Everytime I runthis, I havemythreeseedpointsand I havethisnewpinkdot, whichisthe X y.
Sonowwhatdo I needtodo?
What I needtodois, I needtosay, letmepickoneofthosethreepointsandmovehalfwaythere, soThefirstthing I needtodohereisjustpick a randomnumber 12 orthree, Right?
Butthisisgoingtogiveme a floatingpointnumber.
Sowhat I wanttosaynow, actuallyisgivemefloor, thatwhichwilltakeoffthedecimalplace.
Andthenif I get a zero, I'm gonnadoonething.
Otherwise, if I get a one, I'm gonnadoanotherthing.
Andand I know, I knowthere's allthis, remember?
I know I'm overusingthesoundeffectrightnow, butit's thefirstday I havetousethis.
It's justitmakesmesohappy.
Soif I pickzero, what I wanttodoismovehalfway.
I wanttomovehalfwayrighttothispoint.
Guesswhat?
I coulddosomemath, right?
I couldtaketheexodus.
Theexofthis, dividedbytwo, havegot a new X, butthereisactually a functionin p fivecalledlurklurkstandsforlinearinterpretation, meaninginterpretlatefromonenumbertwo, theotherin a linearfashionbysomeamount.
Soif I wanttolinearly e wanttolinearinterpretIf I wannalearnfromthispointtothispointby 0.0.0.5 watchwhen I gettoDio 50% that's halfwaythere.
So I'm gonnasay X equalsblerp x a x 0.5 and I woulddothesamethingforwhy, Andthen I'm goingtodo.
Ah, here.
I'm gonnadoitwith B X.
Look, it's alreadyhappening.
Thecastgameisalreadyhappeningoverhere.
Look, now I onlyhavetwopointssoyoucouldseeallthepointsendupjustonthatoneline.
Right?
Everytime I restartthis, allthepointsendupgoingbetweenpoint a 10.0.0 andone.
Butnowlet's makesomemagichappen.
Let's dothelastpossibility.
Let's plugintheseaandseewhathappens.
Okay, herewego.
What's goingon?
Do I seesomepatternemerginghere?
Well, I amplayingthechaosgame.
Thislookslikeitcouldbekindoffamiliar.
Let's be a littlebitmoremethodicalaboutthis.
Letmeactuallystartwithunequal, a perfectequallateraltriangle.
I don't knowwhat I meanbyperfect, butthenwhat?
I'm goingtodowhat I needtodoanequilateraltriangle.
Boy, thisisunequal.
Lateraltrianglehasanangleof 60 degrees.
Soif I wanttofigureoutfromthistoppointhowfardownandhowfarovertogo, I justneedtousetheangle 60 degreesandcosignandsign.
I probablygotsomevideowhere I explainedthat.
Right.
Um, so I needtogo.
Youknowwhat I shouldjustdo?
Forgettheeagle.
I know I said I wasn't gonnadoanyedits.
I feelliketheequilateraltriangleis a bitof a diaggressionthat I don't needtohaveinthis.
That's a niceone.
Solet's letmegoback.
So, actually, thiswon't beanequilateraltriangle, butitwillbesimpler.
LetmejustputthesseepointsatthecornersonDhe.
Then I So, uh, so I'm gonnaputtheseseepointsatthecorners, andthenwe'regoingtoseewhathappensthenlet's sowecouldstarttoseesomethingemerginghere.
InsteadofmerelycreatingtheseSirPinskytriangle, I'm goingtomake a versionofthiswheretherecouldbemorethanthreepointsseedpointsandthatasthepointsmove, asthenewlyrandompointmovemovesfrompointtopointtopoint, um, I mightmovebydifferentpercentagethan 50%.
Soifyoudidn't watchthepreviouscodingchallengewhere I madethis, youcouldpausedown.
Gowatchthat.
Oryoucouldjuststayherewithmerightnow.
Let's betogether.
Let's befriendsontheInternetprogrammingstuff.
Okay, sothefirstthingthat I wanttodotorefactorthiswouldplaythatsongagain, But I'm notgonnaoverdoit.
Useitsparingly.
Otherwise, peoplewillgetirritatedandannoyed, and I'm surewe'llhearaboutit.
Thefirstthing I don't wanttodois I amgoingtomakeanyarraycalledseedsymmetrical, etc.
Points.
Let's justcallitpoints.
I don't know.
Let's callitpoints.
Andinsteadofhaving a x A why, what I'm goingtodointhisarray?
Let's getridofthisfirst.
I justwanttorecreatethis.
Exactly.
I amgoingto, uh, say I'm gonnahavethreepointsand I'm gonnacreate a newpoint, whichis a vector.
I'm gonnausevectorcreatefactorfunctiontomake a newpointanywhere, randomlyinthecanvas.
I know.
I'verun a littlebitofspacehere.
That's fine.
Um, loopingoverParisbysemicolonon.
Andthen I'm goingtosaypoints, push V okay.
Andthen I amgoingtohave a pointcalledcurrent, whichisalsogoingtobeAh, a vector, a randomvector.
Good.
Therewego.
Therewego.
Sonowwhat I candoisagain I havejustrefactoredthistoinsteadofhavingseparate X Y variablesforallfourpoints, I haveanarraythatkeepsmythreeseedpointsand I havemycurrentpointinitscurrentpointsandseparatevariable.
Andbothofthoseare P fivevectors, a vectorbeinganobjectthatcanholdon X, y and Z But I'm notgonnause a Z rightnow.
Althoughyoucoulddothisinthree D.
YoushouldYoushoulddothisinthree D But I'm notgoingto.
Allright, Sothen I'm goingtosayfourlet p ofpointsand I'm goingtosaypoint p dot x p dot y Soweshouldseetheirago.
So I couldactuallystarttocreatesomeofthesepatternsbymodifyinghow I pick a particularpoint.
Sothisoneactuallywouldbenice.
Let's doThePentagonwon a pointinsideofPentagonrepeatedlyjumpshalfofthedistance, Butthecurrenttreasureverdictscannotbetosaythisisgonnabeaneasyoneforustoimplement.
Wejustneedtoget a newrandomnumber.
That's notthesameasthepreviousone.
So, um, solet's gobackhere.
Let's firstmakethisfive.
Okay?
Sowecouldseeevenwithfive.
A Pentagonwerekindofgetting a somewhatofaninterestingpatternhere.
And I'm like, I don't knowwhy I obsessoverthissortofstuff, but I kindoffeellike, let's givethisjustlike a littlebitofAlfaandmakethestrokeWaitoneanddo, like 1000 points.