[Music]
okay you hear me also recording her like
this this is working so many technical
difficulties hello welcome to today's
live stream the irony here is that I
actually was starting the live stream
five minutes early and it didn't work so
I'm just waiting till people see me they
can say they sue music is loud okay that
I can that can be adjusted
I see greetings from Denmark okay ooh
here we are
Oh also so hard well life is so hard
sometimes technology I was so ready so
much energy
hey need a plan I was prepared and now I
feel at a complete and total loss I
could because mentally I sort of like
checked out I was like ah it's not gonna
work I'm gonna I'm gonna just like stop
I was I was like 2 to 2 or you were
minutes from giving up
I also unfortunately I'm getting over a
cold and but I felt the need to
livestream today because oh oh I'm gonna
discuss nature of code down the third
stop I felt the need to livestream today
because I am going to be mostly on
hiatus for quite a bit of the summer
hiatus
not from producing content but from
producing video content because I am
hoping to focus my energy and efforts
towards the second edition of the nature
of code book which I hope to finish by
the end of August and then be back full
steam live-streaming in the fall and
making videos that accompany in a second
issue of the book that's kind of the
point
so let me just mute myself for a second
here why I blew my nose what's happening
I'm sure today's sponsor brilliant
taught org is thrilled to be sponsoring
a youtuber who is muting their
microphone and blowing their nose but I
do want to thank brilliant org I'm
excited about looking at brilliant org a
bit today because I want to talk to
about the nature of code book and I
looked this morning at Borges daily
challenge take a look at it now sign up
it for free at brilliant org slash
coding trained the daily challenge from
today relates to examples from Chapter
two of the nature of code so I'm gonna
look at that challenge and solve it with
you at the third stop of today's train
alright but let me go straight I have
not moved to my new studio asks for a
chain
let me move first to the first stop so
this is my this is my schedule for today
I am now unfortunately behind by 30
minutes I have two and a half hours I
had two and a half hours not only have
two hours I probably should skip this
first one but I always I'm putting the
things that I always skip first and
putting the things that I don't usually
skip last so we'll see how this goes so
hopefully this is gonna be a quick one
I'm going to just move full steam ahead
because I lost all that time so I will
skip the usual pleasantries and I'm
gonna go to github.com slash coding
train slash web sites and I'm gonna go
here this is all I need alright okay and
let me fix this
okay alright alright so the first thing
I want to do today is actually walk
through the steps to make a community
contribution to the coding training calm
especially if I won't be live-streaming
for a while we can interact with each
other by sharing more projects based on
the existing coding challenges so let me
also move this down a tiny bit there's
like some stuff going on here what's
over here there's something like that I
feel like is showing up oh it's this
okay you know there we go
okay all right so I'm just gonna get
started here with this
all right here we go just before I do
this quick tutorial taser cake is asking
what's today's schedule let me pull that
back up this is my schedule for today I
don't know that I'll get through all of
it but this is my goal all right oh very
loud
oh and I do have a bit of a sore throat
and still sniffly nose it's like
terrible cold it's so much better today
I think it's completely incapacitated on
Tuesday in today's Thursday so yesterday
was sort of mild and today I feel better
but there's some residual symptoms you
brought hear it in my gravelly voice
yeah I should be singing the ukulele my
that would probably sound excellent
later hello and welcome to a quick
tutorial on how to submit a community
contribution something you made based on
one of my coding challenges to the
coding train comm website alright so
this is the coding trait comm website
you can see the most recent coding
challenge as the time this recording is
number 147 and it is the Google Chrome
dinosaur game but it was my own version
with unicorns and that sort of thing
so if I click here to up here I'm going
to just click - coding challenges and
now I'm on the page with all of the
coding challenges so maybe you happen to
make a project based on one of these
let's find ten print so I think this
particular coding challenge has the most
community contributions that broke the
record which whatever the record is but
you know what let's try a little
experiment here this I shouldn't do this
on my live streams but I'm going to
anyway I'm going to record this
with the green behind me and Matthew is
it so in the new studio that I'm
planning to set up I'm gonna be I my
goal is to be able to record all the
different views cameras and screen
captures two separate files so they can
do more post-production and editing
after the fact of the live streams right
now I can't do that let me do my
description you know you the viewer of
this live stream right now you know what
the coding train comm website looks like
or you could look at it yourself so I'm
going to just describe it and then
Matthew who does video editing for the
coding train we'll add it in the
background after then when I do the
actual tutorial of showing you the steps
I'll come back in okay this is of course
the camera goes off yes and now you're
all seeing my nice green covered laptop
this was the problem it's this is the
problem it's folded in a weird way
high-tech solution here everybody hello
and welcome to a this is a bad idea I
could tell hello and welcome to a quick
tutorial on how to submit your own
community contribution something you
made based on what my coding challenges
to the coding train comm so at the
coding train comms homepage you can find
the latest coding challenge you'll find
a page there for that challenge that has
the video itself links to the source
code in with p5.js with processing with
people hi just web editor just the raw
source code on github all those things
as well as any links to other
supplemental material I refer to in the
video itself then you'll find this
section my favorite section called
community contributions and if you've
made a project based on that coding
challenge you can submit your project to
this page and what I want to do is show
you how to do that in the context of
this tutorial so there's two
possibilities one is that the page won't
have any contributions on it so far
that's pretty rare and you have to be
the first one to add it or if one if
many contributions already exist then
you just have to add yours to the
existing list so let's go to let's pick
a challenge I'm gonna pick the ten print
coding challenge because it happens to
have the most community contributions
and I'm going to show you how to add
your own contribution to that page but
the same the same technique should of
course apply to any of the commits the
same technique of course should apply to
any of the code of challenge pages
editing editing editing alright so how
can we go back to here I don't know if
that was worth it
get a little extra work for a Matthew
where am I here where's my mouse here it
is so let's go to ten print okay alright
okay
all right oh no I froze it froze froze
frozen I wasn't recording to disk
am i back I believe I am back let me
know when you see me back hi again okay
so I don't have to chat up on the
monitor that I look at over here that
you can't see so I will get that in a
second I'm just going to redo that
explanation because it crashed in the
middle of it and I don't think it was
recording properly okay boy we're really
not getting through anything today thank
you everybody for your patience
welcome to Daniel shiffman's no good
very terrible horrible bad bad day I
don't I get that right no good
it's called terrible horrible no good
very bad day yes I should get the chat
back up but let me just do this again
okay hello and welcome to a quick
tutorial on how to submit your own
project to the community contributions
on the coding train com
so after coding drank on the homepage
you'll find the most recent coding
challenge and then if you click on
coding challenges you'll find all the
coding challenges that I've done and
each one of those has an individual page
with a description the video list of
links of things all the source code with
p5 web editor or on github as well as
here it is my favorite part the list of
things that other people have made in
responses creative versions or twists or
improvements on the thing that I coded
in the video itself so if you're
wondering how you can submit yours I'm
going to show you how to do that so
let's pick arbitrarily not so
arbitrarily the ten print coding
challenge it's the one that happens to
have the most community contributions
let's see if we can get another one to
beat that record maybe and I'm gonna
walk you through the steps gonna make my
own little twist on it change the code
and then submit my own version to it
okay so let me go back to here hopefully
that explanation made sense or I don't
think this the stream is really working
but
yet this is on youtubes end this is not
my problem
all right okay all right you know
interestingly enough I was streaming
because of all the problems earlier I
was streaming to YouTube's backup ingest
server and I just switched it back to
the primary one
so hopefully that this is gonna resolve
that issue uh I really think I could be
wrong but I've had issues like this
before which were problems on my end in
terms of a computer freezing or having a
poor internet connection that is not
what's happening right now all of the
checks and tests that I've looked at my
on my end the data is moving out very
very fast
there's no bottleneck nothing is
crashing or freezing and I'm getting
error messages from YouTube itself so I
could be wrong about that I just really
I really don't think this is on my end
this time so and so let me get the chat
back up so at least I can see it just
bear with me for a second and I'm gonna
move on this is let me get the chat back
up
but I'm hoping that I have now resolved
all the issues by switching back to
YouTube's primary server okay
okay so moving along okay here we go
all right here we go first plate this
place to start is on the Cody challenge
page for the coding challenge you want
to submit - and here wait so here we are
on the 10:00 print coding challenge page
you can see these are all of the
community contributions each one has a
link to it with creator's name and the
source code other links discussing the
challenge the description of the
challenge what I want to do first is go
to view code and I'm going to click on
web editor and I'm gonna open this in a
new tab which it does automatically and
then hold on a second
hold on a second everybody
there we go logged in via dashlane
previously was a sponsor things you -
like uh okay great so hold on
close this
energy people energy so here I am on the
10:00 print cutting challenge page I've
got the description I've got links
described in the videos and then here
look at all these community
contributions awesome so there's a link
here to add your own version I'm gonna
go to that with some instructions you
could just look at that but I instead
I'm gonna try to walk you through the
process so the first thing I need to do
is make my own version presumably you've
already made yours but I'm gonna go to
view code web editor click on that and
now I'm here this is the 10 print coding
challenge I will make my own version by
changing these to ellipse and I'm gonna
make this spacing I'm going to call this
I spelled the lips wrong ellipse I'm
gonna call this spacing come in XY all
right then I'm gonna say fill it will
cut this part out this is not important
it's trust again I have to make my own
version so I'm going to click here if
you code i'm gonna click over the web
editor and then now let me quickly make
my own version wait Odin oh wait I got
it now
Matthieu you'll speed through this
okay I'm just gonna start this over
again so here I am on the ten print
coding challenge page I've got the video
itself by our said that I've said all
this stuff so here I am in the ten print
cook Here I am on the so here I am on
the ten print coding challenge page and
I want to add my own version should note
that I can just click this link and
follow these instructions but I'm gonna
walk you through that right now so the
first thing that I want to do is make my
own version
I'm gonna go review code and click web
editor and I'm gonna play it and quickly
just make some changes sickness is bad
so match here this will get sped up
let's make my own version of this
bollocks load corner
ellipse spacing spacing
no no stroke wait wait
yes Phil I'm just gonna make it black or
[Music]
white okay and why does it look so
pixely and I don't really care about
that I guess all right
oh shoot I forgot that I'm logged in as
the coding train and I totally just over
wrote the challenge you hold on get it
back okay
file duplicate imprint variation okay I
made my own beautiful variation of the
ten print challenge where instead of
drawing a line forward or backward I'm
drawing a circle with a white fill or a
black fill there go beautiful right so
this is the link to my sketch I actually
want to go here and do share I also want
to get this so there you go this is my
variation of the ten print coding
challenge where instead of drawing a
line forward or backward I've drawn a
circle and I have filled with white or
filled it black so now that I've made
this project I'm gonna save it I've got
the link to it I'm gonna go over here to
the coding train and I'm gonna click on
add your own version so I'm gonna click
on that it's gonna take me to this
strange page oh what's the deal with
this page Oh new member
hello Justin monk's interest welcome
thank you
yay
I should not be live-streaming when I'm
getting a vertical the format for this
page is something called llamo which
stands for yet another cup language
seriously and you can see here this is
the metadata associated with this coding
challenge it has a title of the number
of the challenge the date it was
recorded the video ID which is its
YouTube video ID that's where the source
code is that's the p5 web editor these
are various links and what's most
important here is contributions so this
is the part that you need to edit and I
would suggest that you just put yours at
the end you could slot it in wherever
you want you put it first because
there's no actual system for this but in
terms of where I would ask you to put it
I think it makes sense to have these
somewhat in order of contribution so I'm
gonna go all the way to the end and the
easiest thing for me to do is to simply
copy/paste one of these contributions
which has four fields in it title author
URL source so I'm gonna copy paste this
and then I'm going to paste it below
sorry everyone now I just realized you
might be asking kind of an important
question where am i where am i editing
this what's going on so this is actually
the github website you'll notice this is
a URL on github.com github is a website
for hosting git repositories a git
repository is a collection of documents
with a history of all the versions of
those documents mostly used for tracking
the history of a source code related
project I would refer you to my videos
on git and github I have a whole series
of about 10 to 15 videos that kind of
like talk more about the that that this
get software and the github website
itself so if that's unfamiliar to you
you might go back and look at those but
you don't actually need to know anything
you don't need to know all of those
details to submit your
you just need to be able to follow these
steps however these steps will only work
if you have a github account so if you
don't already have a github account you
will need to sign up and be logged in
for this to work so once you've done
that I'm gonna go down here I'm going to
add mine I'm gonna change the title to
coding train demo contribution the
author is me Daniel XI mom and then now
it's time for the URLs so I'm going to
consider I'm gonna go under share I'm
gonna consider and again yours might not
be a p5 web editor sketch might just be
a website it might be a git repository
it could be anything but you just need a
link to your documentation of the
project so I'm gonna pick this full
screen one whoops which is this and I am
going to where was I I'm going to paste
that in here then I am going to go back
here and I'm just gonna do the editor
view which is that and I'm gonna paste
that in here and then one thing I'm
gonna do is I'm going to automatically
make a mistake because it's very common
that you'll mess something up so for
example what if I forget the quotes here
I'm gonna make another mistake I'm gonna
add like a couple of extra spaces here
and I'm gonna have this I have an extra
space here so I'm gonna make those
mistakes on purpose and then I'm going
to say I'm gonna say here adding my own
con my 10:00 print contribution circles
instead of lines now here's the other
important thing that it would really
like you to do when reviewing these pull
requests it's really nice that there's a
link to the project in this optional
extended description it makes it really
easy to click and see what you made and
I let's me see them much more easily to
like know what to share and like just be
able to react to it so I would ask that
you
add a link to you here link to demo here
so I'm gonna go back to here I'm gonna
go under share I'm gonna click this and
I'm gonna click this now then this is
the optional it will say you cannot
commit to the master branch but I want
to go to create a new branch for this
commit and start a pull request a pull
request is a is terminology for git and
github where you're saying I'm sorry
excuse me a pull request is a term that
refers to asking me or not mean
particularly but the coding train web
site to pull your new changes in to pull
your submission in so I'm gonna call
this Schiffman 10 print contribute just
Schiffman 10 print I'm gonna hit commit
changes now you can see this is now then
the last step here open a pull request
and it's pretty much filled in for me
now because it took the commit
description in here so I'm just going to
click create pull request and then here
is the next really important thing and
we're gonna wait for this to run
[Music]
I should say what's running here this is
what's known as a unit test is running
and it's running via continuous
integration on a service called circle
CI so I actually have a whole set of
video tutorials also on unit testing and
continuous integration that you can
check out but what it's doing is it's
checking the syntax of your contribution
to make sure there are no formatting
mistakes in or no missing required data
pieces and well it came back now all
checks have failed meaning there's an
error so this is something that helps
you when you make your submission know
whether it was done correctly and this
is so sort of off-putting to have this
big red axe and you feel so terrible
like my submission was wrong in the test
in past no no feel excited and feel feel
good about yourself did you stretched
and made an attempt and try to submit a
pull request bagel is your first pull
request don't get up it doesn't matter
the check failed it's just the computer
checking it you could now make some
edits or you can ask for help at the
coding train community is here on github
to help you fix it up and make sure your
submission goes in correctly but knowing
that the test failed is a bit of extra
information for you so I could actually
go click here on details and it's gonna
take me over and it's it's gonna have
all this information that I could scan
through and trying to find what the
particular error message is but usually
it's a missing piece of data it's a
white space extra spaces or extra
indentation I'm gonna go and fix those
errors now the way to fix those errors
would be to go to files changed click on
wait a second
isn't that where I want to go files
changed Oh edit file yeah I guess it's
just because no if the go-to files
change and click on maybe I should
actually show those errors hold on I
just don't know if I'm showing anything
let's see will this work for other
people who are looking at this who
aren't members of the coding train
scrolling all the way down through all
the tests we can get to the end and I
can zoom in it says extra space at the
end of this line URL editor so you can
see this is the error this is and this
is the error I need to fix unfortunately
it just finds the first air it hasn't as
I found all the errors but I can go back
now to my pull request I can click on
files changed I can go here and click on
edit file and I can go back and I'm
gonna just fix all these things so I'm
gonna get rid of where this I'm gonna
put the quotes around here we're gonna
have those Oh added extra spaces here
I'm gonna click on those and I'm gonna
say commit directly to the Schiffman 10
print branch that's gonna add those
changes to the pull request I'm gonna
hit commit changes and now if I go back
to conversation we can see the unit
tests are running again and let's hope
they work this time
[Music]
there we go all checks have passed this
branch has no conflicts with the base
branch merging can be performed
automatically merging is the act of
accepting that pull request and merging
the changes with the current website
source code so you won't actually see
this button squash and merge by the way
if you're wondering what squash means it
means this pull request has two commits
to separate straight changes and squash
will squash both those into one so it
just could've cleans up the history of
the project because we don't actually
need to separate these two things out in
the grand history of things even though
they are two separate changes for this
request so um you won't see this because
you most likely are not an administrator
of the coding train website and you will
wait for somebody here to to press that
button and once it's done you will see
and I'm gonna do that now I'm gonna do
that now there we go
once that's done all I do is go back to
the coding train dot-com website and I
hit refresh it's gonna take a while this
part out it's gonna take a little while
because that's to rebuild the whole
website
Oh David is saying some David in the
chat says please mention how to do it
with YouTube video IDs because if the
contribution is a YouTube video the
direct link won't work okay so that's
something we should Claire so that's
something I'll be really helpful David
actually to make a pull request to the
instructions to explain that but I will
also mention it
I'm just gonna check what I'm gonna do
is I'm gonna check over here to the
challenge wow it's still not there how
long does it take to rebuild the site my
goodness
Cessna Ty's asking what if we want to
upload code I don't know exactly what
you mean by that
but you you can include a link to your
source code in your contribution this is
not a general how to make changes to the
coding train website tutorial that would
be a completely different type of thing
this is just about adding your
contribution to the yamo markup there it
is okay it's there okay and now we can
be on this page I don't see my
contribution there but I can hit refresh
I'm gonna get refreshed
[Music]
Daniel sheath bond is there and if I
click on this it'll take me over to
there's my contribution if I click on
source code it'll take me over to the
source code page so I should point out
I'm just showing you my my contribution
happened to be a p5 web editor sketch
but what you might want to link to could
be a YouTube video it could be just a
full website it could be a blog post it
could be anything you want
one quick gotcha is that for things that
are YouTube videos don't put the full
URL to your YouTube video in the
contribution just put the video ID the
system itself knows to make the YouTube
video URL out of just the video ID
there's probably some other small
details in theory those things are
covered here under see how if I click on
see how this is a guide to everything
that I just showed you and you can see
the actual format of how to put in your
contribution and how to create a pull
request but this is also something you
could edit and offer contributions to if
there are things missing from this guide
or leave them in the comments of this
video itself
so thank you very much for watching this
quick tutorial about submitting your own
community contribution to the coda trade
comm website I hope this encourages you
to submit yours don't be shy don't be
afraid we're here to welcome you in with
open arms and rainbows and unicorns to
try if this is your first time using
github this is a great way for you to
give that a try and see how it goes
so thanks so much and look forward to
seeing you in a future coda challenge
and having your contribution on the coda
trade comm website bye bye okay there we
go everyone
so Archer is asking what if it's a
malicious site so nothing we're gonna
check we I say we there's essentially a
group of volunteers and so the people
who would be checking this army group of
volunteers on a gruesel house has been
on github has been mostly monitoring the
community contributions and merging them
me I am so me has done a lot of work on
the website Austin I'm sure forgetting
to name people there's lots of people
have made community contributions so if
you want to participate in the
maintenance of the coding train github
repositories reach out to me I'm open to
having more people help with that and I
should also mention SCI who is the new
coding trained community management
manager mostly their work is focusing on
social media and patreon and YouTube
memberships less the github stuff does
there's too much to do but in terms of
thinking about the code of conduct and
how to manage the community that's
something that psy is doing a lot of
thinking of it you could always reach
out and contact sy at sy that's CY at
the coding train com
okay yeah people are wondering why I put
the green screen there sorry there's a
little it's not really an experiment
it's usually what I do when I record
offline if I'm not live-streaming but
just to allow it to have a little bit
more graphics and stuff behind me that
we can add later for the edited edit
version of this okay it is 12:10
oh no no no I have to 1/30 I was
confused I thought I only had 20 minutes
left I was like oh my god I'm not
getting anything done okay let's do the
processing library so give me a second
here so this is done
all aboard we are going to the second
stop really need music and animations
coming soon to to future coding train
live streams if you are an animator who
likes making stuff like this
get in touch I'm looking to probably
hire somebody to create a lot of animal
animations for the live stream that I
can play for different segments and also
I'm taking a break and before it starts
and I'm going to ends that kind of thing
okay so we're gonna open up eclipse
where's this
[Music]
well let me try to time that better I
[Music]
got a better idea
we're gonna make this work it launched
too quickly okay
good enough was written with a newer
version of the product can be
incompatible dis version yeah
wait why am i holding up am i opening an
older version of a cups Paxson no wait
why did it open up this old version of
Eclipse that was weird
no no no exit yeah this one is what I
want okay hold on I get another chance
[Music]
hold erosion no I want this version okay
did I ever figure out how to change the
general view to make the fonts of all
these things bigger oh boy
editor preferences well I cannot I think
I'm just have to zoom
all right so where I last left off so
unfortunately if you didn't tune in to
the previous live stream you will most
likely be quite lost because I'm doing a
lot of sort of obscure medieval stuff
with building a Java library but just to
quickly recap which I'm is I it got the
library to build but haven't actually
implemented any of the source code yet
so and so I'm gonna finish that off I'm
trying to think of what is important for
me to say and do here let me open up
processing
let me make sure this is the right
processing yes it's there okay okay
but don't fear what I did in the
previous livestream is currently being
edited and will be uploaded it probably
took me over an hour but it's edited
down to 20 minutes so there'll be a 20
minute part 1 which will show you how to
get your environment set up and then I'm
hoping this will be in approximately 20
minute part 2 coding the library itself
and then maybe I need to make a part 3
about publishing your library
documenting it that kind of thing
ok is it really just as simple as oh
it's that simple whoa whoa
now I split my pain oh ah there we go
but can I be over here no I well so this
I was able to increase I want to
increase the size of what's over here
but I guess I'm just going to zoom into
it when I want to look so that's what
I'll do okay and then this over here is
show view ant okay so I'm going to close
this right now all right
will it work here I don't know we'll
find out okay hello and welcome back to
part two of building your own processing
library in Java look I'm working with
eclipse
I love the clips all of you will
complain that I'm using eclipse and who
care I love Eclipse it's one of the
first places I learned to program so it
has a special place in my heart so what
I did in the previous part you're
probably gonna want to go back and watch
it if you're here and you didn't was set
up the development environment so
install eclipse make sure I have
processing installed set up all the
paths the build paths the project the
template the cloning all of that stuff
so what I am here right now I
successfully built the library so it
shows up now in processing under import
library and remember I'm choosing open
simplex noise as the topic it's very
arbitrary but I want to build something
that's actually useful can be published
as a real library but the library is
here but if I click this it
automatically adds the import statement
which you can see is just template
library dot star so in this video what I
want to do is code the library itself
and make one example that uses it
probably the hardest part of making a
library is being thoughtful about the
design an ape of the library API itself
how you make the examples and as well as
documenting it so that's more of a sort
of broader topic related to how to
maintain and publish an open source
library but I'm going to mostly focus on
the technical details of building the
thing and maybe towards the end I can
circle back and talk more about so this
looks like key important concepts and
topics to having a kind of healthy open
source project so first thing that I
want to do if I want to customize this
it should say something like import
Schiffman dot open simplex noise or
something like that I mean I don't think
it's what I'm going to call it I'm gonna
go back to eclipse I'm gonna go over
here and I'm looking for under
and so look this is what's known as a
package template dot library and so
because the package name in the template
is just template library that's why the
import was template library so I'm gonna
right click on this I'm gonna go to
refactor and click rename and then I'm
gonna come here and I got to pick a name
for it let's call it noise open simplex
know
let's call it algorithms dot noise
ultimately I think what could be
exciting about this library is to
implement a bunch of different noise
algorithms open simplex noise fractal
noise gradient noise whirly noise so
many different kinds of noise algorithms
could be in here that would be additions
and enhancements to the built-in kind of
original Perlin noise algorithm that's
in processing itself so that'll be my
name I'm gonna click OK excellent now I
want to go into the source code which is
called hello library so I am going to
rename this also by going to refactor
rename and I'm gonna name that let's
call this particular Java class open
simplex noise and I'm gonna do finish ok
great I'm gonna go over here and there
we go so now I'm gonna hit sit list now
now let's just try rebuilding it to see
what happens so I'm gonna hit save I'm
gonna go under window show view ant
whoops let's try rebuilding the library
I don't need to rebuild it at every
single stage but let's just rebuild it
to see if what I did at least could have
shows up with the proper naming
conventions so I know the window show
view ant click here
click here and do ant build build
successful is what you're looking for go
back to processing sketch import library
open simplex noise there we go
so now you can see I got algorithms
noise star why do I have an error
message I have a feeling hold on a sec
interestingly it's giving me an error
message
let's try restarting processing and see
what happens oh I should have saved it
but that's fine
all right I restarted processing and the
error message went away so certain
things that you change if you're
changing the package name even though
the new library files are being built
and brought over into processing
processing has sort of like loaded what
it thought all the package names were
when it started up so you have to
restart so I don't think with every
single change you make while you're
building library gonna have to restart
processing but that certainly is
something not to do from time to time
so let me do this we make this bigger
okay how's that font size a little bit
bigger
one of the things I like to do when
designing an open-source library is
actually write the example first in the
way that I imagined that it might be so
even though I haven't built any of the
functionality of the library itself what
I want what I want to do is look I want
to take like a simple processing Perlin
noise example that uses just the built
in original Perlin noise for the 1980s
algorithm and then change that example
to use an open simplex noise so if I go
to examples math that's what I'm looking
for on p6 under basics under math let's
just take knows 1d and let's look at
this example this is assigning the x
value of this particular circle to the
wif Perlin noise this is assigning the x
value of this particular circle with
noise the noise algorithm I am so I'm so
sad to be like in my head the angst of
all of the discussions of which version
of Perl in noise is not really pearl
noises it noise as the purlin noises
proc noise is like going on and on and
on so let me just take that again this
noise this noise 1d example is mapping
the X location of this circle it's
drawing to the noise implementation in
processing so I'm gonna grab all this
code copy it close this out and paste it
in here and I'm gonna imagine what I
might do so I might do something like
open simplex noise noise and then I'm
gonna say noise is a new open simplex
noise so presumably the idea is that
open simplex noise would be an object in
algorithms noise and so presumably the
idea is that open simplex noise would be
an object inside of the package
algorithms not noise maybe I want to
name that just open simplex because by
definition who knows but I want to
create a new instance of
maybe optionally there could be like a
seed that goes in here because I could
be randomly seating the noise and then
what I would do is say so let me call it
something different for it to be less
confusion let me call it OS noise for
open simplex noise and then probably
what I want to do is say OS noise dot
maybe value pass it this X offset and
actually that's it
cuz really this is such a like even
though the open open simplex noise
algorithm there's quite complex I just
want one function that gives me the
noise value back and I'll call that
value or I could have called it noise I
don't know what to call it
excuse me but again these types of
naming and API design decisions while
incredibly important I'm gonna make a
tackle later and through user testing
and discussion and are less crucial
right now in terms of the nuts and bolts
of how to build your library how dumb
how to think about making a an
open-source library it's so important
but right now I can kind of just pick
something let's pick value I'm gonna go
back to the library I'm going to this is
so oh boy
so much boilerplate I don't like boiler
plates my throat hurts I know it noses
sniffling
let me go back to the library code and
I'm gonna add a function now I'm gonna
add a function called public value and
it's going to receive an argument like X
offset X off and I'm gonna say return
negative 5 so I just want to test out
this idea I want to add a function
called oh this should be public float
value because it's a Java function that
returns a float it receives a float so
again this is not the open simplex noise
algorithm but I am just going to have it
return negative 5 to see if it works
and let's actually just give it like the
number 50 well actually noise should
return a value between 0 and 1 or in
this case maybe between negative 1 and 1
so let's actually make it negative 0.5
and in Java if I want it to be a float
I've actually got to add that F to
indicate float so once again I am going
to build the library
did I freeze no I thought it was frozen
was just me standing still
yeah I'll have to get Simon and David
are both discussing that actually the
open simplex no Lee's algorithm one
dimension but we can just fix the second
dimension so I will handle that later
all right so where was I the library is
rebuilt let's go back to the code B now
it's still giving me this error message
because I think I 5 to restart
processing again but let's just see if
it works
oh oh okay I just had to run it actually
and I did okay oh wait I'm getting an
error the constructor opens simplex
noise is undefined why am I getting that
error because I have a constructor open
simplex noise oh it needs this thing P
applet the parent aha what this is and
how this works P applet the parent is
probably something I should tackle or
address in maybe a third part or a
fourth part to this series because I
don't think that I need it for this
particular open simplex noise library
but what that is it's actually a
reference to the sketch the user of the
library is writing themselves because
there are times where the library has to
interact with the sketch maybe the
library triggers a callback event the
video library does that for example the
sound library belief may do that as well
maybe the library looks up a particular
property that's been set by the sketch
itself so this is a way of having I
don't know that to make any sense cut
that last sentence this is a way of
having the library know something and
communicate to or execute functions in
the users sketch itself it's not
something I necessarily need for open
simplex noise but let me just keep it in
here for right now decide later if I can
remove it but there's it's this is not a
flaw of the library design it's now a
flaw of my code where I need to say this
the key word this in Java refers to this
class and you're processing sketch is
actually a class that's just hidden from
you when you're working and processing
itself so now let me run this and we
could see the negative 320 why is it
negative 320 because I'm multiplying it
by width so that's right we
is 6:40 the value only noise value ever
get back is negative 0.5 x with is 300
right so now we're building the library
and we added our own function to the to
a particular class in the library itself
the next step is let's actually put in
the open simplex noise algorithm so let
me find that where was that originally
mmm okay so let me go back to open
simplex any of these will work
we had this interesting oh it's eval is
the is the function used here
I'm trying to decide what to do so let
me ask your advice here particularly
love to hear from anyone anyone so I
have two choices right now I could what
I really was thinking that I would do is
I would have just the I problem I think
I want this open simplex noise
implementation to remain entirely intact
as a separate class and then I want to
wrap it in my own thing the sort of
issue is it is called open simplex noise
and that's what I called my class for
the library so I think so I could just
like add my processing library stuff to
this I think I don't want to do that I
think I've decided all right I think
I've decided this oh it you stand it oh
right of course I could extend it that
makes a lot of sense why didn't I think
of that but what should I call mine then
you know what makes sense I could just
call it open simplex what if I just
called it simplex noise but that's
different than open simplex noise that's
the patented Ken Perlin noise
OS noise I could do new noise generator
a string open simplex so I I don't so
Simon is suggesting P open simplex noise
which would make a lot of sense but the
key word the letter P is reserved for
core libraries so third-party libraries
shouldn't use that I don't like using
short hands like OS n you know what
though here's what I'm gonna do I got it
I got it I'm gonna rename this class to
like open simplex noise Spencer or
something or KS for this implementation
and then I'll extend it so we'll still
be open simplex noise let's do that
let's do that okay okay let's do that
okay coding training office yeah okay
here is the works raw source code for
Kurt Spencer's 2014 implementation of
open simplex noise and Java now there's
a little bit of an unfortunate thing
which this class is also named open
simplex noise again Here I am back to
this naming thing everything is quite
difficult but let's let me first just
bring this into eclipse
so there's a variety of ways I could do
that but I'm just gonna copy paste it so
I'm gonna make here I'm gonna create a
new class and I'm gonna call it open
simplex noise KS the KS for Kurt's
spinsters spencer's I want to keep that
implementation entirely intact so I'm
gonna hit finish I am going to paste it
in and then I am going to hit save and
then I need to change this to KS I need
to add package declaration and then I
need to find other things like this
should be KS this should be KS whoops
this should be KS this should be KS this
should be KS there we go so now in my
open simplex noise whoa what just
happened oh yeah you have any errors
Oh welcome new member Marko's Hindman
Eze you will be the proud recipient of
some coding train and processing and
other stickers sometime in the next year
hopefully very soon thank you two side
the coding trade community manager is
whipping me into shape and getting me
together with sending out these rewards
here okay now I'm gonna go back to my
open simplex noise class and what I'm
actually going to do is say extends open
simplex noise KS so what I can do
basically is keep the original
implementation intact but have open
simplex noise inherit everything from it
and add whatever I need for this
particular implementation so when I
create it I'm going to give it a
reference to the parent as well as
optionally a seed so hold on what do I
need
so how do I call I say super right
so I thought right so must be first
now I can generate the open simplex
noise through the parent constructor
just by referencing super and let me let
me also give it a seed so I can also say
P applet parent long seed or actor let
me just say int seed because that's what
you'd be getting from processing more
likely and then I can say super seed and
then I can also say this parent or the
parent so this is I believe know how do
I call like can't I oh no because that
is super init nari or whatever
so this is a way of overloading the
constructor in Java I have two ways of
calling you in strokes I shouldn't have
gotten rid of that
if the original s was a member yeah I'm
wondering about that too so that's how I
would have normally done it
just make a instance of open simplex
noise would that be better than this
extend that's what I might that's what I
wanted to do but I thought that was like
bad and so I was doing the extend thing
should I actually make it an instance
what do you think like the other option
excuse me the other option would be I'm
gonna call it like generator this is
what I was more inclined to do can I do
it this way who's a Java programmer out
there this is the way I like doing it
I'm really wrapping it not extending it
nobody nobody has an opinion there is a
constructor in the parent class with the
seed composition is better than
extension that's called composition I
did not know that
yes all right I'm going for it
so I'm backing up I don't like this way
let me just undo
Oh Marvin likes extends Albert your
likes extends Nikki likes wrapping you
should use extend there's a lot more
normal as a Java programmer I didn't
know that what that's called composition
I think it might be clearer though so
hard now I've gone down a rabbit hole
died didn't want to go down all right
let's uh
I'm just curious oh this is like
whatever
twice some site full of ads here should
be able to go to this
I'm gonna vote for composition well it's
one composition one everybody yay bye
ghostly coding thanks for tuning in
okay while we're thinking about this I'm
gonna take a short break
whose 12:45 and I'm gonna come back to
finish building this library because I
want to talk to you about the nature of
code book and today sponsor brilliant
org so let's go to brilliant org first
and I want to talk to you about what
brilliant is look at this look at this
live this is exciting
oh no no no no come on composition look
at this it's so even that that leads me
to believe that I I could be my vote
could count a little bit extra oh boy oh
boy I already let that keep going how
are there that many people voting 44
that's pretty good okay oh look at this
composition heritance is really winning
out here that means I should definitely
do composition cuz I like to do the less
conventional solution okay but wait I'm
talking to you about brilliant org so
thank you so much to the coding trains
livestream sponsor brilliant odd or
guess I mentioned in last livestream the
new thing that I love about brilliant is
there's an app actually and I looked at
today's daily challenge on the app on
the subway on my way to work this
morning and I was like oh this is an
example that's perfect with my nature of
code book which is exactly what I want
to talk about in livestream so first of
all brilliant is a website which has
interactive puzzles and lessons in a lot
of topics computer science physics math
geometry all sorts of stuff related to a
lot of the things that I
try to code on this channel so I
encourage you to check it out that you
could sign up for free at brilliant org
slash coding trained especially with all
my technical difficulties today who
knows how many people are watching this
live stream if you haven't signed up for
it before I would really do be like a
favor to me if you just went and signed
up but and then you want to consider and
think about whether you want a premium
subscription or not and if you do the
first two hundred people who sign up
through that link will get 20% off of
the premium subscription which unlocks
all of the courses and the archive of
the daily challenges and that sort of
thing so what I like to do as part of
the sponsor segment is just pick the
actual today's daily challenge I thought
use the one from like the day before but
this one is good for today and see if we
can solve it together so let me click on
it and let's let's take a look and I'm
gonna do my dramatic reading a few
brilliant org daily challenge shooting
from the moon if you fire a bullet and
let's maybe think about it that it's
it's not a bullet it's like a water
bubble
whatever's into the air it isn't going
to hit the moon so why if I throw this
marker up in the air it's coming back
down why is it coming back down the
force of gravity is stronger than the
you energy and velocity at which I've
thrown this up because gravity's pulling
it down there's also air resistance
slowing it down so that air resistance
is really the main issue it causes a
what a substantial breaking effect so
what if you stood on the moon and did
this could it leave could I take a
marker standing on the moon throw it up
in the air and have it leave so there's
this particular way you can calculate
how fast it needs to be going what it's
the magnitude of its velocity needs to
be for it to escape so and what's
interesting about the moon is there's no
atmosphere so there's no air resistance
which makes a big difference so the
bullet will gradually lose speed as it
travels upwards due to the downward
force of gravity but there's no air
resistance so as it gets further from
the moon right gravity the force the
strength of gravitational attraction
inversely proportional to the distance
that force gets weaker and weaker so if
we could just get far enough that force
is gonna get weak enough and it can
escape the moon's strength of grab that
both you can escape and eventually get
to the earth so there's a way to
calculate this related to the moon's
gravitational field is equal to the
universal gravitational constant times
the mass of the moon times the mass of
my marker divided by the distance so
that we know but thick but something
that I don't talk about too much in the
nature of codebook is the kinetic energy
the energy and this is a way to figure
out escape velocity so the kinetic
energy of this marker thrown up is equal
to 1/2 the mass of the marker times
velocity squared so let me use the
whiteboard over here I'm going to show
you how this relates to one of my nature
of code examples in a second so 1/2 M V
squared this is the kinetic energy okay
coming back over here if the kinetic
energy is greater than the energy so
this energy the moon's gravitational
field is equal to the universal
gravitational constant times the mass of
the moon I'll make that big n the mass
of the marker I'm throwing up little n /
R what did I miss there from the formula
nothing okay great
so the way that you determine if
something will escape completely escape
the moon's gravity is by knowing this is
we're just going to call this e if the
kinetic energy is greater than the
energy kinetic energy so all of these
things are constants it's well the thing
we're trying to solve for is V so I
could solve for that like well let's do
that velocity square
equals G times M divided at times the
mass of the marker divided by R and then
we're also going to divide by M divided
by 1/2 which is multiplied by to look at
this that mass cancels out so which
equals 2 times the gravitational livros
gravitational constant times the mass of
the moon divided by r the square root of
that would be the velocity sorry I know
my notation here is very poor but this
would be so this is the actual escape
velocity for the moon so I kind of went
through I think what's explained here
hopefully I did it correctly so let's
look at the question you have traveled
to the moon and brought with you a high
velocity marker launcher which can fire
brightest 100 off it ok the for your
launcher the mass of the object does not
affect the initial speed so which object
would you fire to have the best chance
of escaping the moon's gravity and
getting back to Earth a bowling ball or
a ping-pong ball or it makes no
difference all right let you think about
this for a second is there a typo
somewhere tazer cake is making the
suggestion to put the train schedule in
the description a hundred percent I need
to do that totally agree I will really
try to do that and I like that Clippy
saying tic-tac-toe since I don't know
how I'm ever going to get to that but
we'll see ok have you thought about this
it should be very clear to you it makes
no difference right because the
gravitational force is proportional to
the mass of the object and the kinetic
energy is also proportional to the mass
of the object if we just need to get the
kinetic energy greater than the
gravitational force if the mass is
bigger then the force is bigger than
sorry then then the energy is bigger the
force is bigger it cancels itself out
that's why it's divided out when I'm
calculating for that what that escape
velocity needs to be this wouldn't
true on the earth because air resistance
is not proportional to the mass so
there's going to be a greater the the
the acceleration is going to affect
something of less mass more greatly
because acceleration is equal to force
force equals mass times acceleration so
acceleration force divided by mass so
this is this is where I want to
demonstrate this to you I actually have
an example so it should be it makes no
difference and hit submit and I got it
correct but I'm gonna go I'm gonna leave
a challenge for you here's my challenge
for you let me go to nature where am I
gonna find this spring nineteen
github.com slash nature of code I'm
gonna go to my syllabus from this
semester go to the wiki and go to web
editor example links and then I'm
looking under forces I'm gonna go to
this fluid resistance one which is fluid
and air resistance is really the same
thing shouldn't actually really should
be called drag so fluid resistance is an
example of a drag force which could be a
gas or a fluid and if I run this example
you're gonna see exactly a demonstration
of this so this is falling instead of
shooting upwards but at the top here all
of those objects of varying mass are
falling through no atmosphere then
suddenly they reach an atmosphere so the
acceleration is equal to with all of
them unless they're in an atmosphere or
a fluid so you could actually revise
this example to make a demonstration of
that escape velocity so what I would
love for somebody to do is to if you
sign up for brilliant org at brilliant
org slash coding train go and make make
a p5 sketch that demonstrates this with
at with the errors with with drag force
and without drag for
maybe based on my nature of code example
and posted here and I'm later this
afternoon to check it out and see if
anybody posted anything so I can look at
it maybe share it in a future livestream
so once again thank you so much to
brilliant
org for the sponsorship of the coding
train live streams that's really helping
me grow what I'm doing as a channel and
the community and I hope you will
consider signing up and being inspired
to make some coding challenges from the
brilliant toward materials as well okay
now just to give you a little bit of
extra time I'm gonna take a short break
I'm gonna leave you if someone could
post this particular sketch into oh you
can't see that URL if someone could post
this particular sketch into the chat if
people have well I'm gonna take like a
five-minute break I will bring this back
up we've done our third stop I'm in this
down fourth stop processing library
continued fifth stop is tic tac toe I
don't know if we're gonna make it to
that stop and I'm gonna say back in five
minutes okay so and I'm gonna disappear
and I'm gonna mute myself and I haven't
buted myself yet have I so please take a
minute to sign up for brilliant org and
work on that problem if you're
interested and I will be back in about
five minutes
[Music]
oh people are asking to see them polka
member thank you you'll be receiving
your coding train stickers sometime in
the next year thank you
[Music]
[Applause]
[Music]
[Applause]
[Music]
[Applause]
[Music]
[Applause]
[Music]
as always I always forget this I'm gonna
do this this dot this dot the star this
star song never forget the Vista as
always I always forget the dis stop this
stop it stop just stop this stop this
this stop this stop this stop this stop
[Music]
this star this star the star this star
song never forget the Vista and was
happy to compose that song for me thank
you everyone for allowing me that little
moment of pure unadulterated happiness
oh it got hot in here
what am i doing now oh oh yeah I've
really thought about this and thank you
to CJ shoutout to coding garden with CJ
if you're looking for more alive
streaming on YouTube with coding highly
recommend you check out CJ's coding
garden channel kind of breath but CJ
made a really good point which is that
actually there is a mech there is a
thought process for why there is a
reason that I could consider for why I
might choose composition over
inheritance or vice-versa
and so let's take a look at the poll
which cut
it's interesting how composition has
really outpaced here inheritance but I
think there's actually a reason for one
or the other and I have a specific
reason why I actually in this case want
to choose composition although I could
imagine the library being done in
another way and I will address that in
the actual tutorial that I'm about to
consider continue so mat-su good luck to
your editing you are a true genius so I
don't worry about you figuring this out
but I am going to close out of these did
any
bunny by the way make a let me just
check I did anybody post anything to
this challenge if you did let me know in
the chat somebody could pick up a link
to it or something and I'm posted in the
slack channel that would be great okay
but I'm gonna close this out now close
this leave this open this we don't need
and I need to go back to here let me get
the clips back up and processing back up
okay
all right hold on a sec
okay talk about the my parent thing and
that okay I think I know where I am okay
all right not a lot of time left people
a certain now eleven year old has to be
picked up from Canada so that's the
thing you know how I often am like in my
live streams I have to leave at this
time and then somehow it's two hours
longer that won't be happening today but
let me at least see if I can get through
this I don't know about tic-tac-toe oh I
would love to do tic-tac-toe we'll see
we'll see all right here we go I'm gonna
go from here now that I have the
original open simplex noise algorithm
implemented as a separate class in my
library I have a decision to make so one
thing that I could do with my open
simplex noise class which is what I
ultimately want the user to make use of
is I could extend open simplex noise KS
and in fact I could make this private oh
I'm not gonna make it there's also the
public versus private thing well just
give me one more shot at this now that I
have the open simplex noise original
implementation from Kurt Spencer as a
separate class here in my library I have
a decision to make ultimately what I
want is for that functionality to appear
in my open simplex noise class and so I
could extend the open simplex noise KS
class that would be known as inheritance
or it could really just wrap it by
making an object in here like open
simplex noise KS generator that is an
instance of a of Kurt Spencers open
selects toys implementation and this is
a referred
composition maybe serve like a rapping
another class as an object and instance
inside of a class so the reason why I
want to do this is I'm trying to I'm not
trying to expose the full implementation
and just add a few like window dressing
things to it although that would be a
legitimate way of designing with library
but I'm gonna do it this way just to
kind of really hide that but have my own
set of functions too that make use of
the implementation there so I'm gonna do
that here and then so in the constructor
I need to create a generator equals new
open simplex noise why do I get an error
oh sorry
to create a new open simplex noise KS
sorry everyone who
and then in this value function and I
don't need this say hello function that
the welcome function is maybe nice to
have this set I'm gonna get rid of this
set variable and get variables those are
all just sort of like template functions
but what I want to do now is instead of
returning some arbitrary number I want
to return the generator and the function
inside of the open simplex noise
implementation is called eval
so maybe I'm actually gonna call this
noise and the function is called eval so
I'm going to pass X offset to eval the
thing is the eval the noise open simplex
noise annotation doesn't allow for one
dimension but for me to get one
dimension I could always just pass as
the second argument as zero so and of
course I could be more thoughtful about
that and this needs to probably this
needs to be a double so I can cast it as
a double will that fix it all right hold
on whoops
hmm so why do I have an error here let's
look at what this error might be cannot
convert from double to float oh right
because open simplex noise
implementation is all done with doubles
but processing and sort of like
simplification only works with floats so
here's where I can now change this to be
a float and there we go so now I have
essentially wrapped the generally the
eval function which works in two
dimensions to work in one dimension with
floating-point numbers and now if I
rebuild the library by the way do I
isn't there a way to rebuild the library
without always going to there there's
some ant build thing here how come I
don't have like can I get the ant thing
up here whatever
by rebuild the library oh there's a
keyboard shortcut option command X Q no
oh alright let's just build a library
the regular way that I know how
rebuilding the library go back to
processing and I'm gonna run this oh and
it's called noise now I renamed it from
value to noise oh now why look at it
there it is ah so there is a big
difference
the Perlin noise implementation in
processing itself ah so there is a big
difference
the noise implementation in processing
itself gives you a value between zero
and one whereas that opened simplex
noise imitation and I'm using gives you
a value between negative 1 and 1 and
while I could remap in my library I
think maybe hmm
I'm trying to decide I kind of want to
do I want to I mean in a way I should
remap it so that you could all of your
code still works with it but having a
range between negative 1 and 1 is also
sometimes often convenient feels wrong
not having a default constructor I don't
know what that means right saumur
alright I know what I'm going to say aha
so something interesting here is that
I'm getting negative and positive
numbers this has big ups ok the current
the noise implementation that's built
into processing gives you a value
between 0 and 1
that opens simplex noise implementation
ah
okay here one more try ah so I am
actually also getting negative numbers
here and this is because the noise
implementation in processing the
built-in noise implementation returns a
value between 0 & 1 my new open simplex
noise implantation which is that mine
I'm kicking it from I really shouldn't
allow for editing
I give up it's totally done all of my
youtubing the wrong way but it's too
late now
I must plow forward so this circle is
disappearing off the screen because I'm
getting negative numbers the the
built-in noise implementation in
processing always gives you a value
between 0 and 1 whereas this open
simplex noise ability sure gives you a
value between negative 1 and 1 so
there's probably some advantages for me
keeping that range between negative 1
and 1
but if I want to make the case that what
I want people to be able to use this for
is to have their current processing code
just work out of the box by changing it
to the open simplex noise function then
maybe what I should do is here I should
actually say I'm gonna say I'm gonna
just call a remap I'm gonna make a
function called remap and we'll make
this can make this private yeah private
float or double remap double Val and
what I'm doing is I'm saying return Vow
plus 1 times 0.5 right because a value
between negative 1 and 1 would shift
between 0 & 2
/ - its shift between 0 & 1 so I'm gonna
do that
remap so what's my error now
why do I have an error here
this is a double
oh there's another error
what do I have on here oh because I mean
to private what No
what went wrong
ah
No
so weird what's going wrong
whoa
it was a nice cast Campea something else
went wrong
hold on I've seen this happen before
rebuild isn't there like a refresh a
refresh
huh
what's going on
oh the problem went away I don't know
what just happened and put this code
back
okay that was weird
I don't know what just happened but it's
fixed now you watch let me use the doc
okay
let's now add functions right so I could
rebuild and test this but I'm pretty
sure that correction will work let's now
add functions for 2d 3d and 4d noise to
make sure those work as well so I'm
gonna do this I'm just gonna do this a
few more times and I'm going to add a Y
offset I'm gonna add a Y offset and a Z
offset and then I'm gonna add a Y offset
Z offset and a u offset and so this
would be X off Y off and again I could
refactor this to probably have them call
each other but I think this will work
fairly well for me and then here so now
so now we have 1d 2d 3d and 4d noise and
I also should add a constructor which
allows me to pass in a seed so I'm gonna
say int seed and I'm gonna pass that
seed to open simplex noise and with no
seed what I'll actually just do is say
there's
it could generate a random seed aisle
seat with like the milliseconds and with
no seed maybe I'll change it to just
call the other constructor this with the
parent and a system current time
milliseconds so I'll use that as the
seed
oh and this should be long sorry
so I have an error here whoops oh it's
because current time milliseconds is a
long data type so maybe I'll change this
to long I think that's probably okay
because you can always give it an
integer and so there we go
so now I have two constructors if I just
say open simplex Noyes this it'll pick a
random seed or I can give it a specific
seed and it'll generate with that seed
so now I'm kind of done with the basic
functionality of this library that I
want it to build so let's go back and
build it again
the way that I did this is bothering
people who are watching the livestream
right now in the chat so another way
that of course I could write this would
be return noise X offset 0 now that I
have this here and this could be return
noise X offset 0 X offset Y offset 0 0
and this one I think this would all be
the same right would it all be the same
you know what though the 4 D calculation
is much slower so I think the actual
implementation is different all right
let me address this
uh-oh it lost it again why does it keep
doing this the clips is so weird
it's
to make this a private class oh no not
this one private
what is going on
we flesh not refresh there's a whole
thing where you can like I've had this
problem before where I can like just
rebuild thought it was refresh
it's back I don't know why it's getting
like lost and confused should I make
this private okay hold on don't resist
it
so people are watching this live right
now in the chat or rightfully
complaining about my redundant
duplicated code here at a minimum let me
refactor this to just have the first one
D noise function just returned this
noise this dot noise this dot noise X
offset zero I do think that the the
implementations as you get to higher
dimensions run more slowly so I don't
actually want to call those with fixed
dimensions but I only want to do that
for the first one so again I'm sure
there's a way to optimize or refactor
that will come later in the building
this library but I just want to get it
to work
so the other thing I want to do just for
right now is let me make this a private
class so that the user doesn't by
accident create and their own instance
of open simplex noise and of course it
just made an error for me because
because it hates me Oh is private like
does that actually break it protected No
I guess it has to be public alright now
i won't i won't address that I'll just
stop here let me rebuild the library one
more time you can't make it private okay
why can't I make it private can't I use
it in the inside that package but other
people can't that we do that you have
our arts yeah yeah private constructor
that's what I need alright I'm not gonna
worry about that right now
alright let me rebuild the library one
more time
huh it's not ant
area
let me rebuild the library one more time
go back to processing and run it there
we go the same exact example but now
with open simplex noise and I hit save
and I'm actually going to now make this
one of the examples whoops
so I'm gonna call this open simply oh oh
s noise one D and then I'm also gonna
save this as OS noise to D let's also go
and grab noise to D and we're going to
sketch import library open simplex noise
for processing I'm gonna make a open
simplex noise noise instance I'm gonna
say noise equals new open simplex noise
this then here I'm gonna say noise dot
oh let's call this OS noise and I'm
gonna say OS noise noise and let's run
this look the same exact example but
with open simplex noise change this to
regular noise and run it it looks like
this change this to improved what I
would say is improved open simplex noise
and it looks like this so that's another
example and so now you'll see by the way
in Eclipse
oh man Thor so you know refresh we hit
refresh you can see that the examples
are showing up here and I can get rid of
this hello example cuz I don't need that
and I now have a fully functioning
version of the library so there's more
that I need to do to document this lot
very to put you know I need to fill out
what's that called
Oh noise one D Oh rename the [ __ ] no I
don't I don't want to do that for inner
classes okay
okay
can I do tic-tac-toe in like 20 minutes
because I could leave it to and I'll be
fine and I'm just about done with this
all right I thought only cycle the
camera just so I'm taking this moment I
finally have a fully functioning working
version of the library with two examples
here's the thing there's a lot more work
for me to do I haven't added anything in
the code comments that will help
generate documentation for the library
I haven't published the library in a way
that it would show up here under import
library add library in this actual list
here this is a way of publishing it to
the processing list of libraries itself
so but this is a good stopping point
because now I'm at a point where you the
viewer could actually use this library
so what I will come back and do a third
video about cleaning up and finalizing
and publishing the library in a more
public way but right now what I'm going
to ask of you the viewer is two things
number one go and download and try this
library yourself so I'm gonna compress
this folder and make a file called open
simplex for noise processing dot zip and
I will add a link to this on to the
github repo so the github repo for this
library is
okay
I'll go you keep giving me a dollar why
are you missing something important
are you just testing J s doc thank you
oh you should you be a dollar so I
notice your comment so by the time
you're watching this this readme file
will be replaced and I will link from
here actually can I just put it in a
release I think I can add it to her
Elise whatever I'm not gonna worry about
this now I will here's the github repo
for the library if you go here the link
to this is in the video's description by
the time you're watching this there will
be more information who has read me
about how to get your hands on this zip
file and manually install it to your
processing download so you can test the
library you can give me feedbacks you
can give me feedback by filing an issue
here on github no issues have been filed
yet and you can also contribute to the
functionality of this and documentation
in this library so if you have some time
and would like to work out filling out
this je s doc 2 information inside the
source code itself if you really don't
like the way I've written these for
annoys bumptious
and want to refactor that we can think
about and have a discussion about the
API design decisions and after I let
that sort of cook for a little while
I'll come back and do a third video to
show you these updates what kinds of
changes I've made and how to take that
final last step to creating a website
and publishing your processing library
to a website and having it appear in the
processing contributions manager itself
alright I hope this has been helpful to
you I look forward to seeing this
project grow we can add some other noise
algorithms to it there's gonna be a lot
of fun in creating this open-source
project as a coded train community and
adding it to processing itself thanks
for watching and I'll see you sometime
soon in the third part to this series
goodbye okay alright everybody
I'm I'm just gonna speed through this
exit the Eclipse IDE yes let me at least
commit all everything I've done we're
gonna move fast here people
okay no no why why do I not have
permission this has never happened to me
I'm gonna have to debug this later I
want to push this the github but I'm
gonna worry about this later yeah I have
hmm I don't know all right I'm gonna
deal with that later today this is gonna
be tic-tac-toe speedrun by the way I
thanks Pedro for your super chat
appreciate it quick word so I won't be
live-streaming very much in July's there
it won't be a complete nothing vegan
burger possible burger no I don't like
the expression nothing burger there
there will there will be content and
there will be some stuff happening but
if if you are let me just quickly say
this if you are currently supporting me
as a patron on patreon or as a member on
YouTube
the actual video content will be slim to
none through July in August but I will
be working intensively on a second
edition of the nature of code book and
so I will be through the those
communities releasing preview drafts of
that book eventually the whole thing
will of course come out and be on the
new website for free for the public so
you have two choices if you are
currently supporting me unsubscribe for
the next couple months because you feel
like I'm not producing enough content to
merit your patronage or stay and realize
that I'm sort of switching gears I'm
just and I'll be back in full force with
video stuff in September and if you're
thinking of joining now maybe you want
to hold off because you feel like you
want to join for that sort of like video
stuff but if you want to get clued into
the sort of inside track of the progress
on the nature of code book I will be
hopefully doing some member-only streams
during for my work sessions on the
nature of code book as well as sharing
draft PDFs and drafts of the website in
our coding train a slack channel which
you get an invitation for okay so yes so
I'm just saying don't edit the timers
we'll put a timer in post and I am going
to give myself till 2:10
to create tic-tac-toe
I have not practiced this at all I have
no plan I'm definitely in big trouble
here this is gonna be a total and
complete disaster but I'm gonna do my
best okay let me blow my nose cycle the
camera oh do I gonna probably want to
use the whiteboard for this periodically
this is such a bad idea
welcome to the coding Train otherwise
called this is a bad idea
is this the marker I want no is this the
marker I want yes all right here we go
people
make sure there's no like emergency
message for me about anything okay oh
here we go
all right
okay oh hello and welcome to a Cody
challenge
tic-tac-toe I'm gonna make tic-tac-toe
I'm hoping when you look at how long
this video is it's very short cuz I
don't have a lot of time right now so
I'm gonna try a trick and make a very
beginner friendly example of the game
tic-tac-toe without any bells and
whistles without a lot of fancy code I'm
not gonna over engineer it I will come
back and the reason why I'm making this
is I eventually want to show you some
different algorithms for an AI or at
least a bot to play the game tic-tac-toe
but that's not happening in this video
I'm gonna make the most basic simple
fredley version of tic-tac-toe right
here using javascript the p5.js library
and the p5 web editor follow along if
you wish and see what happens I have not
practiced or plan for this at all can I
do this in a short amount of time let's
see alright alright I need a board so I
definitely need a board I'm gonna say
let board and I'm gonna just it's going
to be an array and maybe it'll be an
array of arrays and let's use strings
it's probably terrible idea so this will
be the top row this will be the middle
row right tic-tac-toe is three by three
by three and then I need two players so
player one is an X and player two is an
O
this is working so well so now I need to
render the board let's put some like
stuff in it let's just pretend it has
some stuff so I want to render the board
I mean I could use this with Donna
there's so many ways I could do this I'm
just gonna do this with canvas and in
the draw loop so I'm gonna say for let I
equals 0 is less than 3 I plus plus 4
let's let J equals 0 J is less than 3 J
plus plus so this is pretty tricky if
you're a beginner programmer this is a
nested loop and I've actually made this
a grid so every spot in this grid
let me actually fill it out just so we
see something here I'm gonna pretend
this has just been played right so the
idea is that this two-dimensional array
structure this list of lists is storing
all the information for what the current
state of each cell in the tic-tac-toe
grid is at the beginning they're all
blank and then as the players play X's
and O's get filled in so now I go to
nested loop through check every column
check every row and render something so
I could just use the text function right
I could say let's spot equal the board
index I index J and then I could say
text that spot
at X comma Y so where is x and y so I
need a width like I need oh I'm gonna
fill the whole canvas so with equals the
width of the canvas divided by 3 and
height equals the height of the canvas
divided by 3 it would make sense for me
to like have players in an array and
maybe I could I don't I could have 3
doesn't have to be a hard-coded number
because I could make like a 5x5
tic-tac-toe board but I mean I'm doing
this in the simplest way possible so x
equals width times I and and y equals
height times I and then and let's let's
run this what's gonna happen do you see
anything some X's and O's they're sort
of in there and then I'm going to say
that's weird text size 32 to make it
bigger
why they all atop of each other like
that
Oh looking at the check can you guys
discuss the thing about the community
contribution thing later that's
distracting me
Oh oh I forgot Jay here there we go look
there's Mike tic-tac-toe board but
things are kind of like off o because of
the way you know what I should just draw
it as a circle let's just say if spot
let's do this
if spot equals equals player one right
then draw an ellipse at X comma Y with
with right and then otherwise if spot
equals player two then draw a line from
X Y to X plus W X plus h and another
line from X plus W Z Y to X y plus h so
that's me drawing a an X whoa that looks
totally wrong so first of all we say no
fill and the offset should be plus W
divided by two so I need to offset all
those spots whoa oh and then this would
be oh no no no no oh my god oh let's
diagram this I have a three by three
board right
this is kind of x equals zero this is x
equals 1 this is x equals 2 this is y
equals 0 this is y equals 1 this is y
equals 2 so an X should be drawn from
here from XY XY 2 X plus 8y plus h so
the X I did correctly let's go back to
here and comment out the ellipse and
let's make the board all full of X's
let's just make the top rail full of
exes
player 1 is an ex by the way no wonder
Oh No 8/3
what did I do wrong X Y X plus W X plus
h x plus w y x y plus h they're all
going to the bottom
is there time somewhere let X equal W
times J
line 29
XY oh this needs to be why everybody I
just lost like towards like 45 minutes
not really that long by accident because
I had it X here this needs to be Y okay
so now we can see the X's I could see
X's let's draw the grid we could see the
X's well those are really giant X's now
let's put the circles back in ah the
circles need to be I need to say ellipse
mode corner there we go oh boy boy those
X's are connecting in ways that look
really awkward so the x's should
actually also like have like an offset
so let's make like a little buffer
variable like 10 pixels and say x+
buffer x+ buffer y minus buffer why - oh
no wait hold on let's not do that should
draw everything relative to the center
so act so the x's are all kind of
connected in a way that looks weird
so actually would make sense to not draw
everything relative to the corners but
to draw everything relatives of the
Centers and I could just use text-align
and going back with the letters but I
want to draw it I would have drawn so
I'm gonna I'm gonna draw everything
relative the center you'll see this is
gonna improve it why this is a great
this is really going super well so far
so what I'm going to do is say each X is
the its index into its column in row
times the width plus plus width divided
by 2 plus height divided by 2 that
offsets everything by 1/2 and then I'm
actually going to say the size I'm gonna
have something called like the SOT like
the call this the X size I'm going to
have this equal to
w / - half of that and then I'm going to
say X - x size y - x size - x + X size ,
let's just call this XR like kind of
like the X is radius and then this one
will be + XR 2y minus XR and then 2x
minus XR 2y plus XR and then with / 4
there we go there's my X's and let's
make the stroke weight for there's my
X's and now the O's no more ellipse mode
and let's make this W divided by 4 or /
- there we go look this is what the
tic-tac-toe board looks like
yeah like the way it looks better now
that was painful
so now let's set it up as blank oh and
by the way I've reversed my X's and Y's
so I should actually be the X's should
be J and the Y's should be I or if I
actually let's just do it the other way
around
let's keep X's I and Y's J but do the J
loop as the outer loop and the I loop as
the inner loop there we go okay
whoo so now what I want to do next is
play the game so let's say let's have a
variable called current player and
current player is equal to player 1
let's have a let's randomly pick between
player 1 and player 2 so every time we
start the game the current player let's
actually make these players equal let's
make this an array I like the idea of
making this an array
for some reason and let's have the
current player B players index 0 or the
current players players index 1 and then
this we can make one is a circle and
sorry 0 is a circle 0 is the X I did it
right 0 is the X and that's what is the
circle what's going on here where's my
error line 44 too many too many brackets
huh oh I need a closing bracket for
setup okay come back board and let's
make the background as 255 okay ooh
all right so every time we don't know
who the player is now oh wait what no
everything's fine everything's fine am I
gonna do clicking should I have the user
play in which case I need to draw the
lines oh yeah yeah yeah oh this is very
silly because I can say the whole reason
for me doing is I can even p5 I can say
current player equals random players so
this will pick a random player I really
need to see those lines so let's draw
the lines let's draw a line from W 0 to
W height oh no no no so to W the whole
height then we'll draw a line from W
times 2 so I just want to draw that
crisscross and we'll do the same thing
for 0 2 width and this will be H 2h and
then H times 2 to H times 2 now really
what I should do is make this now
interactive so that you could click and
add the X or the Y I think I might leave
that as a little challenge to you I'm
just gonna have the computer play the
game tic-tac-toe and see if somebody
wins
so either the board will be full and
it's a tie or somebody win and I won't
use any intelligent algorithm I'm just
gonna have each player place a random
pick a random spot so what I'm gonna do
is I'm also going to make an array
called available and so each available
spot in the beginning I'll just say
enesta I'm gonna make a nested loop so
much for making me be a super beginner
friendly tic-tac-toe it's all these
things are so much harder so what I want
to do forget about this big super
beginners could do it the way that I'm
doing I think I kind of want to make
this a 1 dimensional array
I'll leave it as a two-dimensional array
so I'm gonna say available dot push an
eye in a J so this is right now every
little pair of of index values for that
grid is available so each time through
draw let's make a function that's called
like next turn and we'll say a spot that
I'm picking is a random I'm gonna have
to get an index index because I want to
remove it is a index is a random number
that's between 0 and the length of how
many things are available and then the
spot is I'm gonna take that array
available and remove that index value
the splice function will remove it and
put it in spot and then I'm going to say
board spot 0 spot 1 oh that's so awkward
but spot is a little array with two
values in it 0 and 1 and so this is not
a comma it's another little bracket look
how horrible that looks let's say let's
do let I equals spot index 0 let J equal
spot index 1 and then I'm in the board
IJ j I'm going to say it's going to
equal the player current player and then
current player should equal let's just
pick a random player I mean this is not
the right way to do it mouse let's just
see if this works
mousepressed next turn so every time I
click the mouse current player is not a
thing random players cannot set property
undefined of undefined board
it's not called board
what's spot all right
console dot log spot array of two things
in it array of two things in it oh
that's weird
why is it two arrays
it's two o'clock
see five dead serve well yeah this is
right all right so that's right
let me console.log I J oh no oh when
it's when I spliced it out does it come
in an array oh how awful it comes in an
array so I need to do that
there we go recode something up the
board okay
this that I've done this in such a super
awkward way I might want to rethink this
but it does work are you watching this
will make a nicer version of this okay
but I want to go back and forth between
the players so current player should
actually be an index into that array so
I actually want to say random players
dot length because I want that to be an
index because then when I am adding the
things of the board I want it to be
player's index current player because
the next player should be current player
plus one modulus players dot length so I
built this in a way that you could have
more than more than two players so it
should be Oh
X Oh X 0 X 0 X oh hey oh one that one
all right so this works with my wacky
implementation now I don't need mouse
press to call next turn I just want draw
to call next turn so it fills up but I
also want to check for a winner check
for a winner
so what I'm going to do I'm gonna write
a function called check winner
and what I'm gonna do in check winner is
see first of all if bored dots if
available dot length equals zero then
console dot log tie so it was a tie so
if the board fills up it was a tie now I
need to check but but first I need to
check is there a winner so let win or
equal on no so I'm gonna say there's a
there's a winner now what I'm going to
do is check all of the first I'm gonna
check all of the ways across so let's
first check horizontal so I is now the
row so if board index I well that's the
is that the row I don't remember
0 equals board index i1 equals board
index I to then winner equals board
index whatever I whichever one it is
okay so if all three of those are equal
then the winner is whoever you picked I
can also check I can check now the
columns I don't remember which is which
but whatever I'm doing one or the other
right then the winner is if they're all
equal then I've got a winner now I need
to check so this would be vertical
except it might be the other way around
and now I need to check diagonal so
that's easy I just want to say if board
0 0 is equal to board 1 1 is equal to
board 2 2
then the winner is bored zero zero and
then I can also check if bored to 0 is
equal to bored 1 1 is equal to bored 0 2
that would be the other diagonal then
the winner is four to zero
and now if there is no if if winner is
still null and available is length
console tie console.log tie otherwise
console.log winner all right x is the
winner but if there's a winner so let
result equals check winner
if result is not equal to null then no
Luke stop the looping console dot log
results okay why am I getting errors
sketch line 59 it doesn't like that oh
okay
his next turn happening next earnest has
to happen after this No
oh I I did something so nuts look at
this I was like that doesn't work if
this equals this equals that that
doesn't work this is the this is the
concept I'm gonna write a function
called equals three ABC and I'm gonna
return if a equals B and B equals C and
a equals C so this this is really the
only way I mean there's other ways but
this will actually check if a is equal
to b and b is equal to c and a is equal
to C if all of them are equal then all
three of them are equal so I'm sure
people have been screaming at there so
now I can say equals three and like this
equals 3 0 I 1 I 2 2 I and then same
thing here board 0 0 1 1 2 2 when I'm
missing parenthesis equals 3 board what
I say 2 0 1 1 0 2 let's see where do I
have parenthesis off give myself some
more room I'm missing a parenthesis here
I'm missing a curly bracket there right
missing a parenthesis here coding is
hard why do i torture myself no there we
go just missing parentheses oh I got an
extra one their line sixty-four where
does it not like me so this is checking
all the horizontal this is checking all
the vertical even I have this mixed up
this is checking the two diagonals if
the winner is null and available link is
zero we have a tie and so otherwise next
turn so I really shouldn't see any
errors is that redundant yes this is
redundant yes can I tree line 62 I
equals spot next turn why am i calling
next turn if there's nothing of there I
just should be a winner or nothing
available we run this one more time so
oh there's lots of console logging going
on oops oops where am I my console
logging somewhere else
oh I forgot it oh I'm not rich I'm not
returning the winner and I'm console
logging a lot of other nonsense here
it's just a return
oh my god it's 211
I'm doing a horrible job at this I am
NOT Rita this should be returned I'm
rushing you should never code and write
take a deep breath and relax while
you're coding return tie otherwise
return winner
now winners No oh they could be equal
they can't be other can't be blank they
can't all be dead somebody wins so in my
check equals rich if a is blank which if
okay I just they have to be full so okay
and a is not equal to blank right
S is not defined line 22 oh whoops
there's s there there we go
X is the winner let's run it again X is
the winner
o is the winner x is the winner so let's
at least make a let's at least say
create p x a crepey winner style color
FFF a result tie yeah I have made my
version of tic-tac-toe in kind of a
horrible way this is it oh and you can't
see it now let me scoot this over here
this was a tie only refresh x1 this one
let's make it more dramatic I don't know
why I'm how do I do a sighs the style
font size was the most ridiculous away
832 point there we go that's what I'm
looking for okay now every time I run it
ty o x o wins and let's change the frame
way we're gonna make this super dramatic
frame rate it's 2:15 I really got to go
frame rate one okay here we go everybody
Oh X Oh where's X gonna go Oh
X oh oh
it was a tie oh no 101
[Music]
let's play this one more time what will
happen place your bets this is like
excellent congratulations ex wow you
really won that one alright thanks for
watching this Cody challenge where I
hate an AI laik tic-tac-toe against
itself you can see how well it's
learning ex just keeps winning over over
again up I will come back you know the
future second part in this I know I say
this for like so many Cody challenge do
you think I'm never coming back son I
think several years I will come back and
fix this as well something called the
min Matt and minimax is it called
minimax yes the minimax algorithm to
actually make thoughtful smart decisions
for how to to actually make thoughtful
smart decisions for how to place your
X's and your own for an AI to up them to
learn how to beat this game and to
always win tic-tac-toe and it's a
challenge to you the viewer take this
version of my tic-tac-toe coding
challenge and when one of the when when
xro wins draw a nice little line through
it to indicate the winning I don't have
time for that right now I should really
add this to this but please add this to
this go to the coding train website
where you will find this challenge on
the website itself and a place to add
your community contribution as well as a
video tutorial about how to add your
community contribution is out now as
well so I hope to see lots of
tic-tac-toe games and computers playing
them people playing them and have a lot
of fun making those and I'll see you in
a future coding challenge good bye it's
not minimax I feel like it's minimax
I think it's minimax all right everybody
I really have to go I don't know what's
gonna happen with all this stuff that I
did today someone could find this link
and share it people can start playing
around with this code and I've really
got a rush out of here
oh the music's is on the loud side
let me rerecord like let me rerecord
that end without music and then so much
if he needs to like make it nicer but
like include music to make it fun we
could do that oh yeah the music is all
the way up hello to the Brazilians and
the Argentinians and all the people want
what is it min max or mini max somebody
give me a definitive answer its min max
some mini max sometimes min Max or
saddle point is a decision rule yes mini
max thanks Dave Dave who submits a lot
they burchett easements lots of
wonderful variations on these coding
challenges alright let me do this again
let's set the frame rate to like two
will make it a little less dramatic okay
good oh and also how come the I'm
nothing wearing alright wait why does oh
look at this so hold on I know why this
has been looking weird this whole time
something's been bothering me about this
the in the draw function the first time
it draws this the stroke weight is not 4
so let's put that here and run it all
right everybody place your bets here it
goes who's gonna win X wins all right
let's run it again you know what you
should do as your own version of this
coding challenge is you should actually
like when a wins you should draw a line
through the winner
I'm not gonna add that cuz but I'm gonna
leave it like this who's gonna win X
wins let's see if we can get a tie
come on tie I don't know why I'm having
the slow dramatic build Oh X wins again
I really want to see a tie back to frame
rate 30 Oh X I wonder what the
probability of there being a tie through
this random method is you can see that
it's certainly not one out of three
right there we go we've got a tie
alright thank you for watching this
coding challenge now there's so much
that I didn't do in this but the and
it's kind of a mess so I'm gonna come
back and eventually make a second part
to this oh I'm not screen capturing
that's fine hold on that's an issue with
my hold on hold on it's a little extra
just gonna do a little extra something
here okay so if you're wondering why I
switch to the green screen I'm gonna let
Matt's you add other visuals with the
coding train web site behind me later
but I don't feel like pulling up now
when this gets edited thank you for
watching this coding challenge with me
doing my darndest to make a very sort of
like ridiculously programmed version of
an AI just picking randomly that is a
way that is one possible methodology for
playing the game tic-tac-toe pick a
random spot play the game to Keiko I
will come back I'm gonna do I know this
might not lets might be it might take a
while for me to get to this so hopefully
you're we keep reminding me in the
comments but I'm gonna come back and do
a second part the reason why I built it
I'm gonna need to refactor the code to
make it more manageable and I'm sure
people will give me some nice
suggestions and make some variations of
that I'm gonna make a oh I hate the way
that I'm explaining this min/max
algorithm take a look at la lanterne
Shelli
alright hold on
I recorded this explanation all right
thank you so much for watching this kind
of strangely implemented version of a
computer playing itself against
tic-tac-toe with its highly intelligent
algorithm of just picking a random spot
each time um please go to the coding
train com where you'll find a web page
for this coding challenge and make a
variation of this you know whether it's
I'm sure there's so much visual stuff
interactivity design that you could add
to this refactoring the code I also
recently made a video about how to add
your own community contribution so I'm
hoping this tic-tac-toe
coding challenge will break the record
for the most community contributions and
I will come back some point in the
future and actually look at some too
traditional
algorithms for solving the tic-tac-toe
game the sort of standard one would be
something called min Max our minimax
which is a sort of decision tree like
solution for looking at all the possible
moves and picking the optimal one so
I've got a refactor the code and
actually build an intelligent algorithm
that's not just randomly picking which
space to go next for the computer to
maybe play against a user and I'll come
back and do that at some point in the
future have a wonderful rest of your day
programming or doing whatever it is that
you're doing today and I'll see you soon
good bye okay I now I've screen captured
because you know obviously I need the
this thing to be behind me that makes no
sense okay screen tic-tac-toe
tic-tac-toe desktop all right everyone
thank you so much for supporting me by
watching by signing up for really tough
origin proceeds out of our coding trades
by joining patreon or being a member or
just by being a person like you
being a human being who exists in the
universe that we all share let's share
it well together and I'm going on
vacation tomorrow for a week so the
least stuff happening on the channel
because I won't be publishing new videos
while I'm away or other people will be
publishing them and then when I get back
focusing on that nature of code book so
you will see very little life swimming
for me well it will happen I'll be back
in full force in September when the new
semester begins a new studio thank you
goodbye I'm going down to cup my spot at
camp at 3:00 it's like a 20-minute
subway ride so if I can get to the
subway in the next 15 minutes I'll be
there on time
okay good bye everybody
[Music]
oh look I think I'm back by accident