inadditiontoeveryonewho's buildingthingshereoverthecourseof a coupleofdays, weaskedMatt, ifyoubuildussomethinginanhour, whichthatwas a nicesurprise, itit's justsayitwas a surprise.
Itwas a surprise.
Okay, thenice, butwe'llwaitandsee.
Sowe'regonnagivethat a try.
Nowwe'llseehowwegeton.
We'vegotanhourtosee.
No.
Whathouse?
Thisiswhatyoudigthroughwillworkthroughittogetherontotallyallit'llshowupyouryourtypingandtalkingskillsAnhouroffmegroupingsthatgo a flowandmakingtyposprettymuch.
I didtreat a littleandspentsometimetodayprototypingWhat I'm goingtookay, beworkingonjustso I'm notgonnastumblingaroundcompletelyblind, butinLet's let's let's seehowitgoes.
Andif I stillrememberhowtowritecodeinbetweenalltheceiling.
And I thinkit's justoneofthesethingsthat I alsotalkedaboutearlierinthelivestreaminhow, how, howgreatitistojuststartgetting a basicflowsetupbeforeweactuallystartbuildingourourthatthatsupportswhatwe'regoingtobuild.
Sointermsofwhatwe'regoingtobuild, youknow, becausethenextthing I know, I'vegivensomethoughttowritein.
Welikeitinthenewrepoinsomewaystogetherwhatthisdeploybuttondoessincethatitsetsup a newrepoandaninitialdeployoff, createreactiveandmakesure I justhave, like, a complete, continuousdeploymentprocesstogloballydistributednetwork.
What I thoughtwouldbereallyfuntodoforsortofanhourlongchallenge.
Isthatback?
About 10 yearsagoinwhen I hadmovedtospeakingfromDenmarkand I wasstillatthetimeworkingas a musicaljournalistinDenmarkandwasstartingtofigureoutwhatwasgoingtostayinSpainandthattherewasn't a lotofworkinworking s a writercoveringmusicinDanish, especiallynotwhenitwaslikecontemporaryclassicalmusic.
Andwe'reyes, inDanishinSpain.
Yeah, Yeah, I likeit.
Itwasn't surprisedatthetime, butitturnedoutthatitjustwasn't that I demandinsomething's wrongwiththeworld.
Butthat's howitwasin.
Okay, Butbackthen, I wantoneofthethingsthatjuststartedbuildingWheresoon?
What's what's thisisSudokuchallengein?
So I builtthischallengewhereyoucould, like, goto a webpageyoucouldgetusthrough, Doc.
Oh, youcouldsolveitontime.
Andthenyoucouldsendthemailto a friendwiththesamesudokuandchallengethatpersonto, like, seeifyoucanbeatmytimeback.
Thenthatwaslike a prettybig A project, actuallyinitwasbackinintheearlydaysofrails, right?
SoSoevenjusttheconceptoflike, Okay, howHowam I gonnamakeaninteractiveyou i forpseudocruisingin a browserifitwasmuchmorepeachbasedof, likehavingalltheseformsandsendingitto a railcontrollerandrenderinginresponseandsoon.
Andofcourse, allallthisdopewithgenerationin I hadtocomeupwith a waytodoitthroughthis.
I foundthisolddepositoryandmeetbackin, like, 10 yearsago.
Soforsomereason, theauthorofthisgeneratordecidedit's nicetohavethenumber 02 eightinsteadof 1 to 9.
Interestingchoice.
Butinnowthat I knowit, I won't spend a lotoftimebeingveryperplexedonon a coupleofthingsgoingintodiscoveredbefore.
Thatis a goodthingtoscorebeforehim.
Butnowthenexttime I makethenextthinglikeoneofthethingsthat I learned a lotfrom a developerwasworkingwithHaskell.
Haskellhasthisverystrongtypesystem, andit's allabouttransformationsoftypes, rightininthebeginning, I wasfighting a lotwiththattoday.
I would I reallylikethat.
Obviously, I didn't picktypescriptonanything, so I'm notgonnadoanythingthatreallydealswithtypes, But I amgoingtostopfromthinking, okay, howdo I wantdatatoflowdownthroughthisapplication?
Right.
So I knowthat I'llendupwithwith, likeanedgethathassomekindofSudokuboard, andthatboardhassomerose.
Andthoserosehassomefieldsinthemthathas a numberthat's eitherreadonlynumberthatcamefromthefromthecastleornonereadonlynumberthatcamefromtheuseofright.
So I wanttothinkoffthebed.
Okay.
Howcan I Howcan I takethisandgeneratesomethingthatthatthatcomeswith a datastructurethatininthatthat I canworkreallywellwith?
Andhowcan I write, writelikeJavaScripteffectively?
It's a question.
So I'llstartbyjustgeneratingtheroarinSudokuin I'vejustseeninmylittleredripplethatmakepuzzleseemsjustright.
Likeifinwhichtypescript I mighteventurnitintoclass, it's ready.
Soeachofthesesosoprobably l halflikeactually a baseopticthathassomeroastineachofthoserosewillbeanobjectthathassomecolumns, I guessin.
Andtheneachofthosecolumnsinthiscase, onething I quicklyfoundout I wanttohaveitliketheroad i d andthecolumnideas.
Soweknowwhatwe'reworkingout.
I wantedtohavetheactualvalue, whateveritis, right.
Andthen I wanted.
Andthen I wentlike a readonlypropertyinthattellswaslike, Isthis a prefilledvaluethatthelike?
Theycan't bechanged?
Orisitsomethingthatcanbechanged?
Right, SosoThisisprobablyanokaystartfor, like, thedatastructuregivesmeforwhich I wouldactuallyatonething, I wouldaddalsohereandindex, thatjustgivesme a key.
Because I knowinlateronwhenwhen I'm buildingoutthisthiswhitetree, whichisreallythewayyoushouldthinkaboutreactright?
Likeyouhave, like, a rudeelement.
Andthenyouhavedatajustflowingdownthrough a threeofcomponents, right?
I justknowthat I'm gonnawantpeaceforeachroadsthatstatesthesameforefficiencyandsoon.
Right.
So I knowthisiskindofliketheinitialdatastructure I wanttocomeupwith, andthen I coulddo, like, normallyOh, doallkindsoffancyfunctionalmapsandsoon.
Have a bunchofstufffinishedbecausetherest I meaneverythingelsewhenthisoneisbasicallyjust, let's see, let's startbythen, likenow, now, myreallyfirstgoal, right?
And I reallyliketowrite, like, workandsmall, achievablegoalsthat I cangettowardshimthatgetsmesomethingright.
I oftenreallylikejustputtingsomethinginthesamefileassignmentinrightbecauseitisinoneplacelogicallyandbecausethat's likemosttraveledrefectoryintheworldeverto, like, putthatintoitsownlittlecomponentpullitin.
Right?
Butrightwhen I'm justplayingaroundit, it's become a bitof a streamofconsciousness, isthinkingofdoingitallinoneplacebeforeyear, goinguptomyeyes, Thingsmaketidyhandsupandgetthem, Getthemreflected, cause, youknow, you'reactuallygonnapushthisatthismomentandthisissomething I'vebean.
I'vebeenwalkingaroundtheteamsduringthedayandseeinghowthey'vebeenworkingsincetheremanypeopleworkingtogether, itwasreallynicetoseethatpeoplehavefairlyquicklyreachedthepointthatthey'resharingcodetogetherin a repoandthey'resharingprogress.
Andthenyoutake a newWell, yes, youdon't yourownchangestheprogressionofthevalueofsomethinghere.
Yeah, it's alwayslike a transformationfromonesetofvaluestoanother.
Right?
And m R is a reallycoolliketheyhavesomegreatnegotiationsoffthiskindofyoutransformations.
Butit's a reallycoolwayoff, offoff, doingitin, racedwithwithoutreallyhavingjusttolearn, likeimmutableGaiussomedifferentkindofdatastructureoranythinglikethat.
Sonow I feeladdedhim, er, andthen I'llimportwhenyouseehowtheydidimportproducefromEmmain.
Andthenwe'lldo a littletrickhere, sowe'llsee.
Okay, producefromthisair.
Let's seeifthiswordsbasicallythewayinmoredust, noticethatithasthislittleproducertakesomeinitialstateandthenitandthenitreturnsin F functionforupdatingthatstate.
Ideally, I wouldhavesetuplikesometestsuiteandsomethinglikethisiswhat I'm missing, that I wouldliketoMaybeif I hadmorethananhourififthisislikereadingprojectwasdefinitivelysetup, somewayofwritingthistleslikethatwouldmakeitsoeasytotowrite a fewartistsofthatfunctionandseeifitactuallymakesitinsteadwaywillwrite a functiontomagicalitself.
So, Chris, forusawayinyourruiningsudokuforeveryoneoninthatsea, whatarewegonnadointomagicallysolvethis?
I guesswecanrunthroughWell, one.
Itwillrun a somesomehow, like, takeeachoftheseandfindtherightvalue U s.
So I guesswecanactuallyjust, like, dosomethingsimilarandseeinthisstage, Doku.
I knowyouknow, ingeneral, honestly, right, Like, it's it's ah, and I'm superlikesomepeoplereall
inadditiontoeveryonewho's buildingthingshereoverthecourseof a coupleofdays, weaskedMatt, ifyoubuildussomethinginanhour, whichthatwas a nicesurprise, itit's justsayitwas a surprise.