[Ann / Help Requested] A nerdy multiplayer game "ants".

Discussion in 'Ruby' started by Brian Schröder, Sep 29, 2004.

  1. Hello Group,

    I hate to put something into the open before it is completely finished,
    but time is running out for me.

    I'll give a course on ruby for CS students next week. The program I want
    to have finished at the end of the course is a kind of a multiplayer
    game. It simulates a simple ants world, and the clients have to
    implement some kind of AI to steer the ants through their life.

    Because I'm not a ruby guru, and I want to teach them "the real ruby
    way" I ask you to donate a bit of your time to look at the source and
    make improvement suggestions.

    I aim on having a compact but readable implementation, that I will be
    able to explain.

    One thing on which is not too clear to me is how secure my
    implementation is.

    The source and more information can be found at:

    http://ruby.brian-schroeder.de/ants/

    Everybody who helps and makes it to Freiburg will be invited on a good
    german beer ;)

    kind regards,

    Brian


    PS: Maybe we could elaborate the ants theme to a ruby-quiz?
    --
    Brian Schröder
    http://ruby.brian-schroeder.de/
     
    Brian Schröder, Sep 29, 2004
    #1
    1. Advertising

  2. On Sep 28, 2004, at 6:32 PM, Brian Schröder wrote:
    > Because I'm not a ruby guru, and I want to teach them "the real ruby
    > way" I ask you to donate a bit of your time to look at the source and
    > make improvement suggestions.
    > [...]
    > http://ruby.brian-schroeder.de/ants/


    I don't have either the time or expertise to fully investigate what
    you've done here, but I wanted to comment on how similar are your
    Observable module:
    http://ruby.brian-schroeder.de/ants/source/observable-rb.html
    and my EventTarget module:
    http://phrogz.net/RubyLibs/EventTarget.rb

    I changed mine to use symbols rather than strings after I saw yours,
    since it's more Ruby-ish. (I had already decided yesterday morning to
    use blocks by default and force &foo for existing method passing.)

    I like how yours allows for 'forwarding along' arbitrary parameters,
    although I feel like I prefer more structure in my life. (Said
    structure being a discrete Event object with specified methods which is
    used to shuttle data between the signal and the receiver.) It feels
    like it provides a bit more de-coupling between the sender and the
    receiver.

    Your names are cleaner; mine are sort of ugly and confusing for the
    sake of consistency with the DOM 2 Events model.

    Oh, and BTW, you have two typos in your Usage example:

    > observed.register:)foo) do | obeserved, *args |

    I'm guessing that shouldn't be "obeserved"...should it be 'observed'
    (to match your usage in the string?) or something else (is there a name
    collision with the parameter passed to the initialize method)?

    > puts "Observered object #{observed} signalled foo with arguments

    #{args.inspect}
    I'm guessing 'Observered' should be 'Observer' or 'Observed'.
    --
    (-, /\ \/ / /\/
     
    Gavin Kistner, Sep 29, 2004
    #2
    1. Advertising

  3. On Sep 28, 2004, at 7:32 PM, Brian Schröder wrote:

    > Hello Group,
    >
    > I hate to put something into the open before it is completely
    > finished, but time is running out for me.


    This is a fun project. Was it inspired by this year's ICFP contest?

    I've been browsing through your source and it looks very nice to me.
    Naturally, some docs would help a lot.

    As far as the game goes, I would like to see more complicated boards.
    Even the ICFP simulator had obstacles (rocky terrain) and the
    programming environment there was far more restricted. You have a full
    programming language to play with, so problems like pathfinding are
    much more reasonable. Might as well take advantage of that, I say,
    opening up the possibility for some clever ant creations.

    > PS: Maybe we could elaborate the ants theme to a ruby-quiz?


    As a died-hard gamer, I'll be very sad if you don't submit this idea,
    when it's ready. :D

    James Edward Gray II
     
    James Edward Gray II, Sep 29, 2004
    #3
  4. Gavin Kistner wrote:

    > On Sep 28, 2004, at 6:32 PM, Brian Schröder wrote:
    >
    >> Because I'm not a ruby guru, and I want to teach them "the real ruby
    >> way" I ask you to donate a bit of your time to look at the source and
    >> make improvement suggestions.
    >> [...]
    >> http://ruby.brian-schroeder.de/ants/

    >
    >
    > I don't have either the time or expertise to fully investigate what
    > you've done here, but I wanted to comment on how similar are your
    > Observable module:
    > http://ruby.brian-schroeder.de/ants/source/observable-rb.html
    > and my EventTarget module:
    > http://phrogz.net/RubyLibs/EventTarget.rb
    >
    > I changed mine to use symbols rather than strings after I saw yours,
    > since it's more Ruby-ish. (I had already decided yesterday morning to
    > use blocks by default and force &foo for existing method passing.)
    >
    > I like how yours allows for 'forwarding along' arbitrary parameters,
    > although I feel like I prefer more structure in my life. (Said
    > structure being a discrete Event object with specified methods which
    > is used to shuttle data between the signal and the receiver.) It feels
    > like it provides a bit more de-coupling between the sender and the
    > receiver.
    >
    > Your names are cleaner; mine are sort of ugly and confusing for the
    > sake of consistency with the DOM 2 Events model.
    >
    > Oh, and BTW, you have two typos in your Usage example:
    >
    > > observed.register:)foo) do | obeserved, *args |

    > I'm guessing that shouldn't be "obeserved"...should it be 'observed'
    > (to match your usage in the string?) or something else (is there a
    > name collision with the parameter passed to the initialize method)?
    >
    > > puts "Observered object #{observed} signalled foo with arguments

    > #{args.inspect}
    > I'm guessing 'Observered' should be 'Observer' or 'Observed'.
    > --
    > (-, /\ \/ / /\/
    >
    >

    Thank you for looking into it. As written in the header, most of the
    observable stuff is taken from a source I don't recall at the moment.
    One problem with the implementation is, that it is quite difficult to
    deregister, if you don't save the original proc somewhere.

    Thanks also for the corrections. Things like this are always slipping,
    and I'm not a native english speaker (obviously ;).

    Regards,.

    Brian
     
    Brian Schröder, Sep 29, 2004
    #4
  5. James Edward Gray II wrote:

    > On Sep 28, 2004, at 7:32 PM, Brian Schröder wrote:
    >
    >> Hello Group,
    >>
    >> I hate to put something into the open before it is completely
    >> finished, but time is running out for me.

    >
    >
    > This is a fun project. Was it inspired by this year's ICFP contest?
    >
    > I've been browsing through your source and it looks very nice to me.
    > Naturally, some docs would help a lot.
    >
    > As far as the game goes, I would like to see more complicated boards.
    > Even the ICFP simulator had obstacles (rocky terrain) and the
    > programming environment there was far more restricted. You have a
    > full programming language to play with, so problems like pathfinding
    > are much more reasonable. Might as well take advantage of that, I
    > say, opening up the possibility for some clever ant creations.
    >
    >> PS: Maybe we could elaborate the ants theme to a ruby-quiz?

    >
    >
    > As a died-hard gamer, I'll be very sad if you don't submit this idea,
    > when it's ready. :D
    >
    > James Edward Gray II
    >
    >

    Thanks for looking at the source.
    Missing docs shure are a problem. I have to take some more time, the
    problem is that I'm graduating and I`'m in the middle of my finals. So
    it now seems like a stupid idea to give the course, because it is much
    more fun than learning my stuff ;)

    I chose a really simple environment, because I did not want it to get
    too complicated. People who have been in contact with ruby only four
    days should understand it. But it is shure that I'd really like to dive
    deeper into this. Only that there is no time for that.

    regards,

    Brian
     
    Brian Schröder, Sep 29, 2004
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lt
    Replies:
    5
    Views:
    552
  2. Tlo
    Replies:
    5
    Views:
    738
  3. Replies:
    0
    Views:
    960
  4. vish_dude
    Replies:
    1
    Views:
    1,201
    mdtsdca
    Nov 1, 2007
  5. Replies:
    0
    Views:
    1,063
Loading...

Share This Page