Forgot your password?
typodupeerror
Java Programming

Learning Java Through Violence 225

Posted by michael
from the is-there-any-other-way dept.
Joe writes: "Someone introduced me to a new game called Robocode and now I'm hooked as well as my 17 year old son. We are both learning Java while playing the game or I should say while building our Java robots. The game is setup to teach you how to handle events, how to create inner classes, and other Java techniques to build more sophisticated Java bots. I have a c++ background so I've been helping my son with his bots, but he's catching on very fast. It's turning out to be a cool and easy way to get the kid clued into programming and best of all its free." I'll bet if the little Logo turtles shot at each other, I would have had more fun programming as a kid.
This discussion has been archived. No new comments can be posted.

Learning Java Through Violence

Comments Filter:
  • Hmmmm. (Score:3, Funny)

    by dr_dank (472072) on Sunday September 09, 2001 @10:25AM (#2270695) Homepage Journal
    Now if we could only have Quake III teach reading, we'd be good to go.
    • hmmm.. making mods is cool stuff .. really u get to learn a lot .. check out planetquake.com and the sites hosted there.. that reminds me.. we can make a mod to teach kids how to make mods and do battle.. kinda like robowars.. but simpler than the current methods used in quake.. with an ide .. gosh.. it's got me itchy :)
  • by Smallest (26153) on Sunday September 09, 2001 @10:25AM (#2270697)
    There was a thing just like this for Amigas in the late 80's that used a crippled version of C for the bots. You could use "radar", shoot things, move, etc.. a lot of fun - and a good way to learn C.

    And, before that, i actually wrote my own version of a programmable bot game for C64, using a homemade 'machine' language. no slick graphics here - you watched the memory space (each bit in the arena's memory space lit up as a single pixel on the 340x280 screen).

    All of this based on a Scientific American article about a phenomenon called "Core Wars".

    -c
    • Me too! It was tons of fun, until one of us figured out how to construct a bot that ALWAYS won. I seem to recall a version of CoreWars for tinyASM as well. Fun times...
    • Was I the only one who went to a college with this type of game? Net trek was fun and all, but even the most relentless ogger needs a break. A friend of mine created a robot wars game in the late 80's for a project in compiler design. You wrote C code; moving the robot, firing patterns, etc. The game had 2d graphics, etc. It was pretty cool actually. If I recall correctly the game engine could handle up to 8 different robots. I wonder what other schools used their Connection Machine for....

      A good way for each person to tout his programming skills. The project was updated over the years by each new class of ACM members. Kind of like a university of maryland cult legacy thing in the com sci department. Anyway, I was under the impression that pretty much every school had their own version of robot wars. I know at one point, U Texas had a world wide robot wars gaming contest based on similar concepts. This was about 18 months or so before lego bots got popular. They truely cunning would like at the compiler code and figure out how many instructions were executed per time unit and craft state machines accordingly.

    • I was pretty fresh out of college with my CS degree in those days, and was fortunate enough to work at a company that was attempting to do some Amiga development. That game sucked huge quantities of time from our small three person development staff. That said, we were probably all better coders due to those experiences.
    • Yes, this game was called Crobots. You can still find copies of it around with some well-placed Web searches.

      There's also a more recent type of this simulation called RealTimeBattle [sourceforge.net] which uses a simple text-based protocol so that you can write a bot in literally any language.

    • To add another entry to the list of similar games, here is RoboWar:

      http://www.robowar.co.uk/

      It is the sole reason I do programming to this day. And the weird RPN language it uses was the first language I wrote in.

      Alan
    • Does anyone know of games that could teach someone perl or php and stuff? Does anyone have a list of games that teach different programming languages?
  • There was a game I played as a kid on my macintosh. It had the same general idea, and i've been looking for something to replace it. Theres a new game called RoboForge out, but it costs money, and doesn't look all that interesting. Thank You!
  • by Anonymous Coward on Sunday September 09, 2001 @10:28AM (#2270705)
    Kill all the other tasks as quickly and accurately as possible before your computer crashes.
  • Most edutainment is really pretty boring, but this seems like a good conceptI think I've heard of something similar based on Z80 processors. Are there many other projects like this (especially for other languages)?
  • Mindrover from Loki has the same idea. The difference is really that it doesn't require you to learn a full programming language, but allows you to program your robots through a graphical building-block kind of interface, with counters, gates and stuff.

    /Janne

  • by interiot (50685) on Sunday September 09, 2001 @10:36AM (#2270720) Homepage
    Yes, robocode is not the first, see DMOZ's [google.com] entry. Corewars was perhaps the most famous. Okay, now we can move on to talking about Robocode's merits instead of talking about its family tree.
    • I'm not sure you can compare corewars to this or the others... With corewars, the actual code is what's doing battle for it's own survival... it's not 'running a tank' or anything, and the playing field is memory space.
  • Lots of kids learned to code this way. Back in the days of Pascal in my high school I found Tom Poindexter's C-Robots and learned C that way (thinking it was pretty much just Pascal with some shortcut characters like braces instead of BEGIN/END). It's a funny coincidence that someone introduced you to the game within a day that somebody interviewed the guy behind the game at kuro5hin, however. :)
  • This sounds tons more fun than that lame ass Karel the Robot [mtsu.edu] baloney we had to go through in high school programming class. Forget the steeplechase, code up a deathchase!!!
    • by bugg (65930)
      I couldn't agree more! I recently took 15-100 (introduction to programming with java) at CMU, and we had to use Karel: The Java Edition [pace.edu] for the first half of the semester..

      Considering most of the people there, such as myself, were already well versed in at least one other programming language, we were needless to say bored out of our minds. By the end of the semester, we spoke our mind at The Fence [24.2.137.94] (you people familiar with CMU will enjoy this..)

      • by maan (21073)
        I can't believe they're using karel here in CMU now...what are people gonna say about us...I'm glad I got credits and never got to do any of the intro classes. Anybody in 212 or 213 around?

        Maan
        • by bugg (65930)
          They're going to say "I'm paying how much for THIS!?"

          Having taken 15-100 in the summer session, I got to be among the first set of victims of Karel. The incoming class now will have to suffer with Karel for the first half of their semester.. it's not a bad concept, but it really could be condensed into a couple days. But DJ Slater is a cool guy, they'll have fun (as much as they won't want to admit it).

    • People are still using Karel the Robot? Holy Hell, that brings back memories. I used that circa 1985 on some sort of PDP-something that the highschool had in the basement. The funny thing is I was just talking to a guy about it on the train this morning :). "Hey, there's a turn right but where's turn left?" "Oh, that's the first lesson, write a procedure to turn left by turning right three times." Ick. Pickbeeper!
  • Just wait until some kid decides to shoot up his school again.

    We don't really know what set off this victim of child-abuse and school bullying who just happened to have easy access to firearms. But we think it might be the fact that he was a Java programmer.

    And we'll have Oprah and Senator Liebermann calling for a ban on applets for a few months afterword.
  • Wow, someone finally gets it, make an educational game that is actually interesting! Seriously, id bet if developers/companies/whoever made educational games that were actually fun to play, they could do well, esp. dealing with computers......programming......stuff like that.
  • All of you browsing ibm's pages have decreased my transfer rate to 2.3K/sec. Thanks.
  • by dukethug (319009)

    I ran Robocode under the OS X terminal using the Linux install/run options, worked like a charm, although it seems that the text in the preferences window got cut off for some reason. If you're using a G4, I highly recommend maxing out the FPS and watching the game fly.

  • Maybe they can combine this technology with the dog-bots from sony [slashdot.org]? Fun will be guaranteed :)
  • Colobot claims to teach you the basics of programming through a game, and I haven't gotten very far in it yet, but it seems cool. You have to program robots to go do tasks that you need done.

    http://www.colobot.com
  • There was a whole range of products out there along these lines back in the mid 80s. I recall one from Origin Systems (back when they were independant) that enphesised the game aspects rather than the programming aspects but nonetheless tought basic programming concepts using a BASIC-like language. As a teaching aid it was somewhat lacking but as a game, it rocked. Battles ere fought in a dufimentry 3D universe set around Origin Systems headquarters in Austin Texas. They even offered the ability to upload your robots for competition against other players where the stats were available on a BBS where members could review their rankings. Granted the online competitions weren't realtime and Blizard's battle.net is a far cooler forum for online gaming, but all that proves is that technology marches on and that Origin Systems was way ahead of their time. I think the game was called OMEGA although I'm not sure.

    --CTH
  • Another idea.. (Score:3, Interesting)

    by dwlemon (11672) on Sunday September 09, 2001 @11:00AM (#2270773)
    Has this been done?

    What about a programming puzzle game? You'd get a task and some constraints and have to write a program that meets the requirements.

    from "Output the alphabet without using any character literals." to.. something more complicated. permutations of a string?

    It'd just have to parse the source file to see if they followed the rules, see if it compiles (warnings not allowed!), and then run the program with whatever input it needs, and parse the output.
    • Such a thing exists. (Score:3, Informative)

      by khaladan (445)
      It's called TopCoder, located at www.topcoder.com (use my name khaladan as referrer if you sign up). You can participate in a contest usually once or twice a week with 7 other programmers trying to solve various problems of increasing difficulty.

      It's based on time. Whoever submits code the fastest, gets the most points. Of course, then there's a challenge round where you inspect other people's code for bugs, and if you find one, supply input that will produce bad output (or crasht the program).

      It's a greate contest. Currently you can choose either Java or C++ to program solutions in.

      Plus, if you get 1st, 2nd, or 3rd place in your room (of max 8 people), you get $150, $75, or $25 dollars, respecitively. I myself have not been playing very long but I got 2nd place once, and sure enough, a check came about two weeks later for $75.

      So, sign up and try it... use my name, khaladan, as the person who referred you.
  • down they go. (Score:2, Offtopic)

    by SubtleNuance (184325)
    wow, weve /.ed IBM.

    Bend to our will IBM l0z3rzz.

    • It's just getting slow but doesn't crash. I'm still downloading the game at 1.2K/sec, 1hr to go. Not too bad really. :)
      • by revscat (35618)
        Y'know, I think that /. should set that up as a motto somewhere. "News for Nerds. Stuff that matters. And we took down IBM's webservers, so watch it, bucko."
  • by DrXym (126579)
    This kind of game came out 16 years ago as C-Robots [nyx.net].
  • This reminds of of one of the programming projects I had to do for my introductory C++ course in school was an artillery simulator. The final program had to input the angles you wanted to launch the shell, and you had to hit certain targets around campus. It was pretty fun.

    -J5K

  • by Grelli (98061) on Sunday September 09, 2001 @11:13AM (#2270798) Homepage
    There are those that will tell you it works exactly opposite this.

    You Learn Violence through trying to program in Java!
  • by n3m6 (101260) <n3m6@ho t m a i l . c om> on Sunday September 09, 2001 @11:18AM (#2270811) Homepage Journal
    kuro5hin has a much more in depth look at robowars [kuro5hin.org].

  • Java robot-programming systems have been around for a few years. My room mate created one three years ago called
    J Robots [mobydisk.com]. His inspiration was the C-Robots which many people have already mentioned in their comments.

    There are a few other Java robot systems listed on Dmoz.org [dmoz.org].
  • In 7th grade Comp Sci class (only in San Jose, CA!) we used Robot Wars on Apple ]['s that did similar things. Robots would be in a 2-dimensional plane, had a motor, radar and a cannon. You could control these things with code. Your bots would fight each other on the screen. By the way, I had the best bot in the class! I even beat the bots built by the teacher's sons, who were CS students at San Jose State and he always bragged about them.

    Anyways, I've been craving a modern version of this for some time now and haven't been able to find anything. I've thought of building one but I'll have to check this one out.
  • intergalactics.net (Score:2, Informative)

    by Chagrin (128939)
    intergalactics.net [intergalactics.net] also allows users to create Java robots to test and play them on the server.

    ...which is where I wrote my first (and last) java class. Ech.
  • Lame! (Score:2, Interesting)

    by vishakh (188958)
    Real men play Core Wars [corewars.org] and learn assembly. This does beat learning Java in Prof. Thronton's ICS 22 class [uci.edu] tho. :-)
  • I was gonna pay to go to a Non-credit Java course at the local college (I'm only in high school). I'll probably still go but this will definatley help. and being a amer it should be pretty fun to.
    c-bob out
  • Did we just /. and IBM server?
  • realtimebattle (Score:1, Interesting)

    by niklaus (139415)
    For those who don't care about Java but want to program robots, there is a similar program called realtimebattle [sourceforge.net] which lets you write robots in any language you want (ok, any language which can read and write standard input and output).
  • Why not make it be multi-lingual? Why just Java? Supply an API that any language can use. This issue comes up whenever stored procedures are mentioned and somebody wants to use another language besides PL/SQL or Java or whatever.

  • by egdull (142805)
    In middle school, I built robots for a pascal-based fighting environment such as this one.

    I notice now that I was merely imitating the coding practices found in the example code and the code that my friends and I shared.
    I was learning interfaces and code structure in a very oblique manner.
    I wasn't learning program structure or timing.

    It was a lot of fun, but I didn't walk away from the experience with anything more than a cursory memory of what code is.
  • The learning company had a cool game out that you had to put different gates together to make robots to complete quests. It was non violent. Very fun! I'm not sure why they don't sell it anymore. I wish I could get a copy for my neices and nephews.
    anyone know what happened to this game??

    Faith
    • And I thought I was the only one who had played this! It was called Robot Odyssey, I believe, for teaching logic and the basics of electronic components. I actually called them (The Learning Company) to see if I could get a copy. The people that I talked to hadn't even heard of it, and said that there were "no plans" to re-release a game by that name. Currently, the only way that I have found to play it is via Commodore emulator... If anyone has found a way to get a PC version of this, I would also love to hear about it.
  • Does anyone remember programming in the game ZZT?

    That was a blast, and a fun way to learn OOP.

  • by cvanaver (247568) on Sunday September 09, 2001 @12:29PM (#2270964)
    Can be found at: http://www.robocode.net/
  • I get violent when they make me use Java, too.
  • MindRover (Score:5, Insightful)

    by OverCode@work (196386) <{moc.liamg} {ta} {edocrevo}> on Sunday September 09, 2001 @12:39PM (#2270988) Homepage
    http://www.cognitoy.com

    And, of course, Loki ported it to Linux.

    It's an incredibly addictive robot battle game. You generally build robots with a GUI interface, but for serious hackers there is an object oriented definition language called Ice that compiles into the same VM code as the GUI builder.

    -John
  • FYI: Robocode doesn't like Sun's JDK 1.4 Beta 2. I'll presume it'll play nice with 1.3.1.

    Also, downloading the .jar with Netscape 4.77 (Windows) didn't work (mangled file), but wget (from my Linux server) did.

    Maybe this will get little brother interested in programming, he likes to destroy stuff...

    Damn, Slashdotted IBM. Obviously they need to devote one of those S/390's running Linux to Alphaworks :-).
  • Violence in a game is always seen as a terrible thing. Especially in this day and age with violence everywhere, I really don't see 2 tanks shooting each other as incredibly violent. Have you played Soldier of fortune or any recent 1st person shooter? You can de-limb a victim and see the blood splatter against the wall.

    Even if this game is violent think of what it is doing, it's trying to get people involved in programming and computers in general. I attend an engineering school and have been amazed at the number of people that have no computer knowledge of any sort, especially in a technological field. Things like this could get people involved at a high school level in computers, so violence is bad, but sometimes the benefits are worth the cost.

  • I waited years to find a copy of this game. Unfortunately it didn't age well -- the robots are programmed with logic gates and IC's, and they don't shoot each other -- but it's fascinating nonetheless.
  • by Anonymous Coward
    actually, there are tons of these programming game.

    A project like Real Time Battle (http://www.lysator.liu.se/realtimebattle/)allows you to use any language.

    look at this page

    http://www.cs.mcgill.ca/~stever/games/

    there are about 20 programmin games there
  • Well, I guess kinds were taught to program with flowergames in the 60's, the "stoned peace" age.
    So it's kind of logical that they learn it with violence now, we are of cource in the "I'm on speed and very aggressive" age ;)
  • I've seen a lot of ones like this, but the one I liked the most was AT-Robots. It was based on Assembler, and it was entertaining enough that even though assembler is hard to learn I actually learned *some* of it by playing this. The address: http://www.necrobones.com/atrobots/

    Entertaining stuff.
  • http://robocode.turbochicken.com [turbochicken.com] - This is a site that me and some of my Java buddies are putting together for fun. We've just started it - but already have most of the back end done. Please stop by and check it out. We're looking for suggestions and ideas before we officially launch it. So, please read the stories on the homepage to see what we have in mind for the site then send feedback to the email address posted on the homepage. Also, I've compiled a list of links to other RoboCode websites, tutorials, and discussion forums. By the way, the upload/download and save features are disabled for a few days. Check back towards the end of the week to start actually exchanging source and class files.
  • by plastik55 (218435) on Sunday September 09, 2001 @05:25PM (#2271540) Homepage
    There are a number of these kinds of games. Other people have mentioned Crobots, Jrobots, and a dozen others I've never heard of. One of my favorites was RoboWar [robowar.co.uk] for the Mac, because it used a very small stack-based language, designed in such a way that the processor speed of the robot was limited. Each robot could execute only a limited number of operations per time step, which meant that efficient implementation of your algorithm was the biggest factor in how well your robot did. The author of the game also held annual tournaments that aspiring RoboWarriors could submit their entries to, and see how they fared against the state of the art. That meant that the robots, even with very limited computational capacity, had a very rapid evolution toward very sophisticated algorithms. Early robots just roved around and fired whenever they saw something in their sights. As time went on, the entries seen in the tournaments were able to camp in corners, dodge incoming fire, "lead" their targets, and employ inter-robot communication for team battles.


    Learning throgh RoboWar to produce advanced behaviour out of a slow and limited language was a great help when I later went on to dabble in embedded systems--the skill set required is very similar.

  • Anyone has develop a bot that won the 'Wall' bot? I worked hard on it in vain. Please!

It's a poor workman who blames his tools.

Working...