This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#26 2012-09-12 06:08:04

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Tic Tac Toe in Javascript

Lucario621 wrote:

Hardmath123 wrote:

My code uses a true game tree — for the given position, I play all completions to the end, and select a move which leads to me winning in the end. http://wiki.scratch.mit.edu/wiki/Game_Tree  smile

That's interesting! I forgot we had a wiki article about that.  tongue  I guess that involves recursion, right?

Yup! Recursion rocks.  big_smile


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#27 2012-09-12 06:16:27

nathanprocks
Scratcher
Registered: 2011-04-14
Posts: 1000+

Re: Tic Tac Toe in Javascript

veggieman001 wrote:

Lucario621 wrote:

nathanprocks wrote:

This does not work in Internet Explorer (Chrome is broken).

Hmm, I don't know how to help you with that.  hmm  I can't get it to work with my IE9 browser either, but I don't really know why.

Because Microsoft sucks at web standards??

+1 Look at the console in IE9 and it says there is an error in line 32, char 2 or something like that.


http://carrot.cassiedragonandfriends.org/Scratch_Signature/randomsig.php
http://trinary.site40.net/images/scratchrank.php?username=nathanprocks&display=small

Offline

 

#28 2012-09-12 11:16:03

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: Tic Tac Toe in Javascript

I beat easy easily.

[][][]
[][][x]
[][][]

[][][]
[][x][]
[][][]

[][][]
[x][][]
[][][]

Do those moves to win.  tongue

I won medium too. And hard.

Very nice! c:


http://i50.tinypic.com/312u714.jpg

Offline

 

#29 2012-09-12 12:16:42

zubblewu
Scratcher
Registered: 2011-02-17
Posts: 1000+

Re: Tic Tac Toe in Javascript

I beat expert  tongue


........................................................................................................................................................................................................................................

Offline

 

#30 2012-09-12 12:56:40

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Tic Tac Toe in Javascript

Cool, Luc! I didn't know you know JS.  tongue
I know it pretty well. The first game i ever made in JavaScript was a silly little thing i called Catch!  tongue

I was able to beat easy and medium on my own, but hard was a bit too difficult. I eventually used kayybee's advice quoted below to beat expert.

kayybee wrote:

How to beat expert:
1. Center
2. If gone on side, restart. (it may be possible to beat it like this, but I don't have time yet to figure it out). If in corner, go in direct opposite corner.
3. If made 2 in a row, block. If not, go to the place to make a fork.
4. Win.

Does this work?

Yes!

Offline

 

#31 2012-09-12 14:46:04

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Tic Tac Toe in Javascript

scimonster wrote:

Cool, Luc! I didn't know you know JS.  tongue
I know it pretty well. The first game i ever made in JavaScript was a silly little thing i called Catch!  tongue

Cool game scimonster!  smile


http://i.imgur.com/WBkM2QQ.png

Offline

 

#32 2012-09-12 15:47:35

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Tic Tac Toe in Javascript

Lucario621 wrote:

scimonster wrote:

Cool, Luc! I didn't know you know JS.  tongue
I know it pretty well. The first game i ever made in JavaScript was a silly little thing i called Catch!  tongue

Cool game scimonster!  smile

Thanks.  tongue

Offline

 

#33 2012-09-12 16:41:45

MrFlash67
Scratcher
Registered: 2012-08-08
Posts: 500+

Re: Tic Tac Toe in Javascript

On Easy, when you win with all the squares filled, it pops up with the win, then the draw.


Who would win, SOPA or PIPA?

Offline

 

#34 2012-09-12 17:35:14

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Tic Tac Toe in Javascript

MrFlash67 wrote:

On Easy, when you win with all the squares filled, it pops up with the win, then the draw.

Hmm, I never noticed that. I should probably add a feature so when you click on a square after winning/losing the game, then it won't allow you to put an X.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#35 2012-09-12 22:07:00

thebriculator
Scratcher
Registered: 2011-07-11
Posts: 500+

Re: Tic Tac Toe in Javascript

scimonster wrote:

Cool, Luc! I didn't know you know JS.  tongue
I know it pretty well. The first game i ever made in JavaScript was a silly little thing i called Catch!  tongue

the time does not reset after you are done playing.

I got 28 seconds, then it said 50, then it said 75.
but really, the times were 28, ~22, and ~25.


.     http://tiny.cc/2cwgpw    http://tiny.cc/viwgpw    http://tiny.cc/iwwgpw

Offline

 

#36 2012-09-13 09:37:19

Mokat
Scratcher
Registered: 2011-12-08
Posts: 1000+

Re: Tic Tac Toe in Javascript

I want to learn Javascript but I don't really have the time because of school.  hmm  I might try to learn some over Christmas/Winter break.


http://www.eggcave.com/egg/977371.pnghttp://www.eggcave.com/egg/977376.pnghttp://www.eggcave.com/egg/1005291.pnghttp://www.eggcave.com/egg/996745.png

Offline

 

#37 2012-09-13 13:03:17

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: Tic Tac Toe in Javascript

Mokat wrote:

I want to learn Javascript but I don't really have the time because of school.  hmm  I might try to learn some over Christmas/Winter break.

My dad may teach me JavaScript, and I want to.


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#38 2012-10-03 05:03:29

trinary
Scratcher
Registered: 2012-01-29
Posts: 1000+

Re: Tic Tac Toe in Javascript

That's quite interesting.  smile


http://trinary.tk/images/signature_.php

Offline

 

#39 2012-10-08 12:31:26

transparent
Scratcher
Registered: 2011-04-19
Posts: 1000+

Re: Tic Tac Toe in Javascript

Nice, Lucario. That was quite enjoyable. :3


yes, yes i do.

Offline

 

Board footer