05 Nov, 2009, Runter wrote in the 1st comment:
Votes: 0
So I thought this was pretty nifty.

http://rubygame.org/forums/viewtopic.php...

It's basically a game intended to help teach the ruby language. If you run ./bin/rubywarrior it will guide you through creating your first challenge. Then if you go to the correct "level" that it created which is ruby-warrior/beginner-tower/level-001 you will find a README that was created. It's basically a description of the level you need to complete.

To complete it you must go into the .rb file associated with the readme in this directory and editor your Player class with provided commands to complete the level. Once you are satisfied you can go back and run ./bin/rubywarrior once again and it will execute your commands on your player and score you. Possibly generating your next level and your new instructions.

Even has an optional graphical frontend.
05 Nov, 2009, David Haley wrote in the 2nd comment:
Votes: 0
I've seen some similar things. At my university the intro courses had early assignments that involved programming a little creature through a world, kind of like logo I guess but with some very basic interaction with the world beyond moving around. It was in Java, though, and originally in C even.

I think the concept of teaching a programming language via scripting a character's actions to be pretty interesting and have lots of potential. It also opens up interesting potential for having a game where the whole point is to script your avatar against others, so it's kind of like "who can write the better AI" or something like that. (More of a programmer's game, perhaps.) Such games exist in various forms, although I haven't had the chance to explore them very much.
05 Nov, 2009, Runter wrote in the 3rd comment:
Votes: 0
David Haley said:
I've seen some similar things. At my university the intro courses had early assignments that involved programming a little creature through a world, kind of like logo I guess but with some very basic interaction with the world beyond moving around. It was in Java, though, and originally in C even.

I think the concept of teaching a programming language via scripting a character's actions to be pretty interesting and have lots of potential. It also opens up interesting potential for having a game where the whole point is to script your avatar against others, so it's kind of like "who can write the better AI" or something like that. (More of a programmer's game, perhaps.) Such games exist in various forms, although I haven't had the chance to explore them very much.


Yes, it seems to me to be a poor replacement for deep study of a language but it particularly might be useful for helping people think through specific problems they may not have been really faced with having to solve before. The AI requirement in this game seems to go from simple to complex–at first allowing you to build an AI that works on a specific case and eventually, out of necessity, slowly building the AI to traverse a complete dungeon with unique problems using what I count to be 20 built-in tools to do it.
05 Nov, 2009, David Haley wrote in the 4th comment:
Votes: 0
I agree that it's not at all the same as proper study but as you say it's a nice intro to a new kind of problem.
What kind of built-in tools does the challenge framework provide? Are you talking about things like search algorithms that need data plugged in, or something else?
05 Nov, 2009, Runter wrote in the 5th comment:
Votes: 0
David Haley said:
I agree that it's not at all the same as proper study but as you say it's a nice intro to a new kind of problem.
What kind of built-in tools does the challenge framework provide? Are you talking about things like search algorithms that need data plugged in, or something else?


By tools I mean things to plug in here to write your AI.
class Player
def play_turn(warrior)
# your code goes here
end
end


You get access to the full language (so yes, you could cheat.) but there are rules laid out you are honor bound to follow. (Or else you're just cheating yourself, really.) The gist of it is you can only do one of the commands per turn. You can use the others however you like to decide which command to do.


Here's some of the "commands" your player can do inside of the player class.
Quote
warrior.walk!
Move the warrior in some direction around the game.

warrior.attack!
Swing your sword to attack the enemy in specified direction.

warrior.rest!
Gain 10% of max health back, but do nothing more.

warrior.rescue!
Rescue a captive from his chains (earning 50 points).

warrior.light!
Light the torch to enable "look" sense. Only lasts 7 turns.

warrior.pivot!
Rotate in a certain direction. Abilities usually perform better in front of you.

warrior.shoot!
Shoot your bow & arrow forward.

warrior.throw!
Throw a bomb. This ignites a 3x3 square hurting everything in it.


Then here's some of the info gathering things you can do that do not cost a turn.

Quote
warrior.feel
Feel what is one square away from yourself.

warrior.look
Lets you see exactly what is in a given direction. Can only be used after lighting a torch.

warrior.listen
Tells you what units are near by, but not exactly where.

warrior.health
Tells you how much health you have.

warrior.distance
The distance you are away from reaching your goal (the stairs)


Additionally here's some of the properties you can get from a Space class once you have returned it with feel.

Quote
space.empty?
If true, this means that nothing (except maybe stairs) is at this location and you can walk here.

space.stairs?
Determine if stairs are at that location

space.enemy?
Determine if an enemy unit is at this location.

space.captive?
Determine if a captive is at this location.

space.wall?
Returns true if this is the edge of the level. You can't walk here.


I kinda suspect the guy who made this game had some type of experience with text based games at some point.
12 Dec, 2009, Chris Bailey wrote in the 6th comment:
Votes: 0
I somehow managed to overlook this post. Neat! (Sorry for the necro, just wanted to acknowledge it)
0.0/6