Video Poker

Basic and Machine Language

Moderator: Moderators

User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Wow, that sounds good!

The update of the winning statistics is very nice, I missed it myself.

And the rest sounds good, too! I think the code is unreadable already, so no change can make this worse - I'm very astonished that you are able to understand and modify the source in it's state :-)

I will put up your version to my web-space on monday.

Btw, I had a look at the game on a real VIC this afternoon, I think it looks much better on the original than on emulation - the aspect ratio on emulation is quite disturbing. Now that I have setup all my hardware again, I will try to test my programs more often on a real VIC, then I can see bad color decisions earlier. On emulation all combinations of foreground and backcolor look ok, which s definately not the case on a real VIC...

Schlowski
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

So now I put your version to my web space

http://www.stojalowski.de/files/videopoker

and removed all old and obsolete links from this thread.
It began to become very confusing with all these old versions :-)

One should never say never, but I really can't imagine how to improve this further...

Nice teamwork, this was really fun!

Schlowski
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

And here is the proof for the aforementioned concept "never say never" :-)

I made two little changes:

1. Put 4 Spaces in front of "winning table" so it is more centered

2. Changed the bottom lines for
"1-5 TOGGLE SPC=DEAL"
" SPC=DEAL P=POINTS"
to
" 1-5 TOGGLE SPC=DEAL"
" P=POINTS SPC=DEAL"

so that SPC=DEAL aligns neatly ;-)

Only for the delimiter line "---------------" below "WINNING TABLE" I did not find the needed bytes...

One thing for your optimizations: Great little trick to replade IF...THEN with ON...GOTO blocks, I would never have imagined to use this as a replacement :-)

Schlowski

PS: New version is on my web already...
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Okay! Well, keep on as long as you like! :lol: Btw, I have updated the page a little too and made the screenshoot look a little more real:
http://user.tninet.se/~pug510w/datormuseum/vpoker.html

That IF->ON trick only saves one byte btw... ;)

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Each byte counts :lol:
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

I changed line 69 into:

Code: Select all

69 DIMP$(5):P$(1)="{right}":FORI=2to5:P$(I)=P$(I-1)+"{4 rights}":NEXT
removed P$(5) from line 70 and put the following at the end of line 31:
:FORI=1TO22:PRINT"-";:NEXT

And I still got 35 bytes less than before.... But for some strange reason, you get "OUT OF MEMORY" anyway, if you win and then press P. I have no idea why. Anyway, something for you to go on! ;)

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

hehe, I had (nearly) the same idea for some of the "{down}{down}..." strings and got the dreaded 'OUT OF MEMORY' error too at the same position - when pressing "P". Must be a problem of temporary strings or something like that. The RIGHT$(" "+STR$(P(I,Z)) creates some temp strings and deletes them afterwards, seems that the garbage collector does not have enough space for shifting strings around :-(

The actual version is running fine, I'm at game 90, having 566 coins left and still no memory problem. (I got 5 times 4-of-a-kind, wish I could make a pay out now :-) )

But I'm willing to get my "---------" line back again, there must be a way - I have only no idea for the moment, but I give not up! Maybe sleeping one or two nights about this will help...

Schlowski
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Just sent you another version ;)
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

And I just tested it and it looks beautiful :-)

When beginning with this program I never imagined what this would lead to. And of course I had sworn that it will be impossible to implement all these features in a pure basic program in 3.5k.
Look at this, Microsoft, it's written in your own language without wasting megabytes of memory :-)

New version is uploaded so download as usual and have fun :-)

Schlowski
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

And just when you thought there was no more bytes left... another version ;-) (in your mail)

Btw, I just realized that I used the Swedish keyboard characterset for "Björg". So it will probably say something like BJ£RG on your vic. So you could change that if you like...

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

The neverending development of VideoPoker :-)

I made it "BJOERG", so to call to 'internationalize' my name and put the resulting version up to the web space...

One thing that bothers me is the amount of winning points - this seem to be too high. I have a game with more then 500 coins left after nearly 100 games. Me personally thinks the most fun is in the beginning and in the 'endgame' when only a few coins left, just to see if one can make it another few rounds. Having hundreds of coins kills the fun for me somehow. Maybe we should make the winning points more straight, something like 1 to 9 or so, since it's not about money and chances but fun? Then (at least for me) it would be nice to have straights, flushes etc. but it would not destroy the whole game.

Let me know your thoughts...

Björg
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Yes, I agree. It's easier to win than to lose. How about
1
3
5
7
9
13
20
50
100

Or maybe we should go about this in a scientific way. Maybe we should play 200 rounds each and then look at the point table and calculate it in some way according to how often you get the different points. The problem then is that I never have got the last 3 ones... Maybe you can calculate the whole thing or maybe there are calculations on the internet of how probable it is to get the different kinds. But how do you handle the deck and the shuffling in your program? Is it like a real deck that gets reshuffeled when it's empty? Or do you get a newly shuffled deck for each round?

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Calculating was in my mind, too. But then I realized taht for calculating the chances for different wins is depending on how someone chooses the cards to hold.

For example here is my 'strategy':
After first deal look if anything is more then once, i.e. hold each pair and better, even if it's only a pair of cards<J.
If no pair or greater, look for flush, if 3 or 4 cards have the same suit, hold them.
If no flush in sight, look for straight, if there are 4 cards in order, hold them.
If nothing else, simply hold anything above 10, because on Jack or greater a pair would win.

This strategy will lead to very different resuklts compared to a strategy which always tries to get straights, for example.

So I do not have any clue how to calculate the chances :-( Only thing which I could calculate is the winning chance after the first round without hold and redraw, this is simple mathematics.

The cards will be drawn from one deck. The deck is initialized at start in ascending order 2 to ace from diamonds to clubs and then shuffled. Shuffling is simply changing two cards 25 times.
Afterwards we will pick a starting card between 1 and 42 and show the five cards from here. If cards have to be redrawed, they will be taken from the next cards.

When the round is over, simply the shuffling will be called again and random start card is choosen and so on.

With real cards this would be shuffling, take some cards from top and put them to bottom and show the 5 cards now on top. If cards have to be dealt, they will be taken from top.
After the game is over, put all cards together and shuffle again. (To be more precise, put the cards back in the same order thay where taken, put the cards from the bottom back to the top and then shuffle - but on the other hand the shuffling is quite different between program and manual shuffling so this is not so important :-) )

Maybe in a 3k expanded version I could get my strategy into the program and let the VIC do the hard work, let it play some hundred rounds and see what the results are - could be a nice thing to implement for another rainy evening 8)

Björg

PS: I was thinking about another version of this using not one but 5 decks, one for each position. This would change chances dramatically, but you would be able to get 5-of-a-kind...
Boray
Musical Smurf
Posts: 4064
Joined: Mon May 03, 2004 10:47 am

Post by Boray »

Then I think this would be the best: We both play the game for about 100 to 200 rounds. Then we look at our points and final score and suggest scoring points that would give more of an even result (ending at maybe 10-25 points). Is that good?

/Anders
PRG Starter - a VICE helper / Vic Software (Boray Gammon, SD2IEC music player, Vic Disk Menu, Tribbles, Mega Omega, How Many 8K etc.)
User avatar
Schlowski
NoMess!
Posts: 892
Joined: Tue Jun 08, 2004 12:20 pm

Post by Schlowski »

Sounds good to me, i will try to give the results by tomorrow evening.

Björg
Post Reply