Hydra First Look: My first program: A bug fix for Reversi 02-15-16 018
Garnet R. Chaney
Posts: 3
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
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Help to build the Propeller wiki - propeller.wikispaces.com
Prop Room Robotics - my web store for Roomba spare parts in the UK
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
This is bizzare that all fry's aren't carrying it, we have to work on that.
Andre'
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