LEGO Tic-Tac-Toe robot

This was actually built for a competition where robots played other robots… no human intervention allowed. It only uses 3 motors, but can clean up after itself… something I’m still working on with my children.

For more information on the details, I’ve put up a comic strip explaination of sorts on Brickshelf:

http://www.brickshelf.com/cgi-bin/gallery.cgi?f=161188

Duration : 0:1:55


[youtube XhfGQGGFb68]


Posted

in

by

Comments

25 responses to “LEGO Tic-Tac-Toe robot”

  1. HaloMuderKing Avatar
    HaloMuderKing

    Holy Crap thats …
    Holy Crap thats awsome

  2. Daxana15 Avatar
    Daxana15

    i no its funny lost …
    i no its funny lost by your own invention omg it could be to powerfull runnnnnnn for you lifeeeeesssssssssss…………….lol

  3. brdavis5 Avatar
    brdavis5

    This was programmed …
    This was programmed in NQC, a “C-like” language built on top of the stock LEGO firmware for the RCX. The method is a simple (custom) evaluation function applied to every cell, with the piece being played in the cell with the highest “score”. I really should have looked on-line first, but figuring it out myself was far more fun.

  4. salezmaker Avatar
    salezmaker

    5 stars!!!

    what …
    5 stars!!!

    what programming language did you use?

  5. cloverbaberental Avatar
    cloverbaberental

    Sweet. you built …
    Sweet. you built that hu? cool!

  6. luigirox88 Avatar
    luigirox88

    so cool!
    so cool!

  7. brdavis5 Avatar
    brdavis5

    No actually – this …
    No actually – this was done with a single RCX. I have a friend who has built one based on the NXT (named W.O.P.R. – search for that + NXT here on YT), but I’ve yet to redo this.

  8. McTopaz Avatar
    McTopaz

    Try it! Even if it …
    Try it! Even if it just is more programming and no lego constructing.

  9. brdavis5 Avatar
    brdavis5

    That’s not a bad …
    That’s not a bad suggestion – perhaps I will. It’s still very easy to explain, but not as well-known a variation, so it might be more “interesting” for the human player.

  10. McTopaz Avatar
    McTopaz

    Nice! I think you …
    Nice! I think you should change the functionallity a bit.

    1) Let each player only place three pieces on the board.
    2) When a player have three pieces on the board, let the player pick up one piece and places it somewhere else on the game board.

    This will make it more realistic.

    By player, I mean you and the robot.

  11. bhusduyhdf Avatar
    bhusduyhdf

    So does the robot …
    So does the robot have to touch all the pieces to see were there at so it can know wat spaces are empty and which are not?

    But anywais good job i did one similar to this.

  12. brdavis5 Avatar
    brdavis5

    Yes… that’s a …
    Yes… that’s a feature I really loved about it, and in fact it does better than my kids on that point ๐Ÿ™‚

  13. MrFree2 Avatar
    MrFree2

    It even picks up …
    It even picks up it’s own blocks at the end of the play, so cool ๐Ÿ˜€

  14. lucasschmitt1991 Avatar
    lucasschmitt1991

    amazing…
    i’m now …

    amazing…
    i’m now startin to build the parts…
    its a project from school…so no legos included…just PIC and work…
    Thanks …congratulations !

  15. brdavis5 Avatar
    brdavis5

    Yes, well… I * …
    Yes, well… I *might* have done that on purpose so that the video would show something more interesting than yet another “cat” (draw).

  16. Daxana15 Avatar
    Daxana15

    lost buy your own …
    lost buy your own machine how sad

  17. brdavis5 Avatar
    brdavis5

    Building it took a …
    Building it took a few days – the hard part was the gripper that would raise/lower/open/close all using one motor, and the rest took a single evening. Programming it too a little longer, perhaps another four evenings more or less.

  18. lucasschmitt1991 Avatar
    lucasschmitt1991

    Its really amazing. …
    Its really amazing…could you tell me how long did you take to do that?…. i am looking to build one of this, but without lego…
    thanks

  19. upsidedownsoup Avatar
    upsidedownsoup

    wow man.

    I just …
    wow man.

    I just think thats really amazing. and your right, you could in fact get it to play chess with just a slight nodification to its programming.

    instead of scanning and going back and picking up a peice, it would only need to scan, and then decide which peice to move and move it.

    very amazing dude. that rocks. you should work for a robotics company of some sort.

  20. brdavis5 Avatar
    brdavis5

    You could make it …
    You could make it do 4×4, or bigger – the mechanism I used can be expanded rather easily, and would scale up to a much larger board. And the programming is, well, just programming – there’s no reason it couldn’t play chess (although the amount of memory and processing power is rather limited). In fact, I’ve thought of adapting Gardner’s mini-chess (5×5 board, all types of pieces & legal moves), but haven’t moved that way… yet.

    Yes, you could make this an adaptive learning program as well.

  21. upsidedownsoup Avatar
    upsidedownsoup

    dude thats so cool …
    dude thats so cool though.

    you basically made something that in a way, learns…until it gets reset, but still.

    hey, think you could make it do a 4×4, or even bigger?

  22. brdavis5 Avatar
    brdavis5

    Actually… it …
    Actually… it doesn’t. Since each turn only one square should be marked, it just looks for the single cell or square that has a new block (it remembers where all the blocks from the last turn were. If you watch it’s only checking previously empty cells each turn for this reason.

    Yes, you can “cheat” and move blocks around, or put in two at once, etc. It umes the human will play a fair game. Otherwise, it would require more checking to catch such cheating.

  23. upsidedownsoup Avatar
    upsidedownsoup

    oh man.

    thats …
    oh man.

    thats cool.

    how does it destinguish the blacks and whites….. wow that sounds racist

  24. brdavis5 Avatar
    brdavis5

    Fair enough – I …
    Fair enough – I couldn’t answer right away because I was hiking in the Rockies, doing off-trail routes up 12,000′ peaks. Honest. What were you doing this week ๐Ÿ™‚ ?

    And yes, I still get things like this built “for fun”.

  25. tennisboy29 Avatar
    tennisboy29

    dude u neeeed to …
    dude u neeeed to get out of ur room…smell the precious life u’ve so sadly wasted away =(

Leave a Reply