BASIC 'Hearts' game
Posted: Mon May 18, 2020 2:03 am
Hi all,
well it's - 'Hearts', the card game that you play when you are pretending to work, now for unexpanded Vic-20. Written entirely in BASIC. (I'm wondering if someone has already done this, but I just spent the better part of an hour searching, apparently no..)
The game includes the following rules / variants :
- 2 Clubs always goes first
- You cannot lead a heart unless a point card has been played
- If you 'shoot the moon', everyone else's score increases by 26
- First round is not 'safe' - if you have no clubs, you can trump with a point card
The computer players don't play what I would consider to be an 'optimal' game, nevertheless they still provides what I think is a reasonable level of competition.
This is the first thing I've done in BASIC on the VIC since I was a kid. I was using the Programmer's Aid cartridge for the first time (really this was just an excuse to see what that cartridge does, after all these years), and I have to say - it made the task much much easier than I remember coding on the VIC to be.
EDIT : Fixed a 'randomising' issue, now plays different games each time you start it.
EDIT 25/5/20 : - Better randomising
- fixed scoring bug when player shoots moon on last round
- Various bits of screwy code fixed
- Slightly more efficient play by computer players
well it's - 'Hearts', the card game that you play when you are pretending to work, now for unexpanded Vic-20. Written entirely in BASIC. (I'm wondering if someone has already done this, but I just spent the better part of an hour searching, apparently no..)
The game includes the following rules / variants :
- 2 Clubs always goes first
- You cannot lead a heart unless a point card has been played
- If you 'shoot the moon', everyone else's score increases by 26
- First round is not 'safe' - if you have no clubs, you can trump with a point card
The computer players don't play what I would consider to be an 'optimal' game, nevertheless they still provides what I think is a reasonable level of competition.
This is the first thing I've done in BASIC on the VIC since I was a kid. I was using the Programmer's Aid cartridge for the first time (really this was just an excuse to see what that cartridge does, after all these years), and I have to say - it made the task much much easier than I remember coding on the VIC to be.
EDIT : Fixed a 'randomising' issue, now plays different games each time you start it.
EDIT 25/5/20 : - Better randomising
- fixed scoring bug when player shoots moon on last round
- Various bits of screwy code fixed
- Slightly more efficient play by computer players