Shop OBEX P1 Docs P2 Docs Learn Events
Hydra First Look: My first program: A bug fix for Reversi 02-15-16 018 — Parallax Forums

Hydra First Look: My first program: A bug fix for Reversi 02-15-16 018

Garnet R. ChaneyGarnet R. Chaney Posts: 3
edited 2007-10-18 06:01 in Propeller 1
Just picked up my Hydra last night at Fry's in Concord. Only some of the Frys are carrying this in stock... I tried out a lot of the demos, and read the first 200 pages of the book last night.

I tried out the reversi program today, and discovered that it cheats very badly!· When it doesn't have a move, it just moves somewhere anyhow!·· I decided debugging this would be a good way to dip my toes in the water of programming this system.

To debug this problem, I made the top status area smaller text, and then added some strings for displaying "Move", a move #, "Chips taken", and # of chips flipped.· Eventually I confirmed that·the computer player was cheating....· Spent·a lot of time figuring out the right place to put the MoveCount++· and where to set the·TakenChipsCount variable so that my debugging would show the right info. Eventually·figured out·the·bug·must be in the CountStones routine.

Eventually after reading the code a few times, I discovered the· rCount+=lTemp·· at the end should have an if lFound in front of it:

···· if lFound
········ rCount+=lTemp

Now the game is a lot more difficult, although I still beat it!

Not a bad way to learn my way around the system.

I went through my junk box and dug up all the accessories I bought for my collection of Basic Stamps, but have never had the time to really play with. LCD displays, AY-3-8910 sound chips,·'164·serial to parallel shift registers,·various extra stamp modules....

In trying to figure out how I want to hook these things up to my Hydra, I am wish the Hydra board had header connectors next to all the pins of the processor so it would be simple without a soldering iron to bring the signals out to a breadboard. I know I can just unplug the chip and move it over to the breadboard, and then have lots of wires going back to the socket.... Maybe I'll have to hunt up a ribbon cable that terminates in a 40 pin dip at each end. Or maybe I'll solder some headers onto the 128K expansion board and be happy with those signals.....

- Garnet

Comments

  • CardboardGuruCardboardGuru Posts: 443
    edited 2007-09-29 17:11
    One day to read 200 pages of a manual and find a fix a bug. That's pretty good going!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Help to build the Propeller wiki - propeller.wikispaces.com
    Prop Room Robotics - my web store for Roomba spare parts in the UK
  • Garnet R. ChaneyGarnet R. Chaney Posts: 3
    edited 2007-09-30 17:57
    It's a challenge just trying to figure out what I want to do next.· I came across the LED hat http://www.weeoo.com/wiki/display/articles/Fun+with+LED%27s+and+Microcontrollers·and that's close to a Christmas idea that I have.... Was thinking about using a Propeller as
    • christmas tree light controller
    • controller for all the lights on my motorcycle
    • the basis for a wrist watch·
    • controlling a·taser based muscle stim exercise unit· "No, it doesn't hurt so bad when·the RISC processor·PWM's it·properly, just don't touch me while it's time for my treatment..."·
    • A talking bicycle speedometer with GPS....· "Skid detected".....·"You've never been here before...."
    • Portable EEG recorder
    • Merlin - the game with the four lights and sounds that challenges you to·repeat the pattern.
    • Recreate the old 1970's LED football game

    My·19 yr old·son, who is programming averse, was intrigued by the Hydra. He, my 7 year old, and I went through downloading almost all the demos last night and talking about each of them. We were playing with the TinyBasic examples, but couldn't quite figure out the syntax for the·random number function, seems like it's not really tiny basic. Some documentation more than just the source code would have been nice.....


    Post Edited (Garnet R. Chaney) : 10/1/2007 7:50:58 AM GMT
  • AndreLAndreL Posts: 1,004
    edited 2007-10-09 20:42
    It didn't cheat, that's just "street rules" [noparse]:)[/noparse]

    This is bizzare that all fry's aren't carrying it, we have to work on that.

    Andre'
  • PocketLintPocketLint Posts: 31
    edited 2007-10-18 06:01
    yeah, I introduced that bug in my last minute update right before the Hydra cd went gold (went to press).

    I had fixed that and one other that I long since forgot what it was.



    Glad you had a chance toplay with the program. After all, that is what the demos were for. Just demos to spark the imagination of a future developer!



    Any questions, just let me know. I check the forums from time to time, time permitting (grin).





    Bob
Sign In or Register to comment.