Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBC] An exciting card game

Author
Message
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 31st Jan 2008 04:48 Edited at: 10th Feb 2008 23:47
Hi there!

Are you a betting person?

Here then is a completely revamped version of Acey Ducey, an exciting card game, in which you are dealt two cards and are invited to place or not to place a bet depending on whether or not you think the next card dealt will fall between your two cards.

You nominate your starting bank [minimum of 100 dollars] and it fluctuates according to the result of your bet.

Should you decide not to bet and a win is possible, you will lose 10 dollars.

The game lasts (a) a maximum of 17 hands x 3 cards, (b) until you lose all your money, (c) until you terminate the game via Esc or F12 key, whichever comes first.

The attached zip file contains the necessary media required to run the game.

Enjoy.

gearce
(GRC)




LANG MEY YER LUM REEK

I’m getting outta this one horse town - Just as soon as it’s my turn to ride the horse.

Attachments

Login to view attachments
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 11th Feb 2008 00:33
Why don't post edits bring the subject back to the top of the list?

If they don't, then the threads are unlikely to be revisited, thereby rendering the chance of comments less likely.

Something for the powers that be to have a look at methinks.

gearce
(GRC)

LANG MEY YER LUM REEK

I’m getting outta this one horse town - Just as soon as it’s my turn to ride the horse.
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 12th Feb 2008 20:00
@Gearce
that's a good point

gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 19th Feb 2008 01:13 Edited at: 19th Feb 2008 01:15
Hi there!

190 views and no comments.

I would find it hard to believe that nobody has downloaded the media file and ran the programme.

If you have downloaded the media file and ran the programme, any feedback would be much appreciated.

Re

Quote: "Why don't post edits bring the subject back to the top of the list?

If they don't, then the threads are unlikely to be revisited, thereby rendering the chance of comments less likely.

Something for the powers that be to have a look at methinks. "


Anything from the powers that be?

gearce
(GRC)

LANG MEY YER LUM REEK

Minds are like parachutes - they only function when open
DB PROgrammer
17
Years of Service
User Offline
Joined: 9th Feb 2007
Location: Nowhere But Everywhere
Posted: 19th Feb 2008 19:14
Quote: "Why don't post edits bring the subject back to the top of the list?

If they don't, then the threads are unlikely to be revisited, thereby rendering the chance of comments less likely.

Something for the powers that be to have a look at methinks."


I'm guessing it so that people don't just hit the edit button to bring their post back to the top.

BTW I'm going to try the game right now.


If it was illegal to be stupid we'd run out of room.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 20th Feb 2008 04:09
DB PROgrammer

You could be right. Didn't look at it that way.

gearce
(GRC)

LANG MEY YER LUM REEK

Minds are like parachutes - they only function when open
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 26th Feb 2008 23:20
DB PROgrammer

Any comments?

gearce
(GRC)

LANG MEY YER LUM REEK

The future depends on what we do in the present.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 9th Mar 2008 00:33 Edited at: 9th Mar 2008 00:43
Hi there!

Quote: "Posted: 18th Feb 2008 18:13 Edited: 18th Feb 2008 18:15

190 views and no comments."


Now over 380 and just 1.

Doesn't anyone else have any comments ... constructive or otherwise?


****** EDIT ******

Quote: "No questions Here , Snippets Only"


Oops! Have I broken the rules ... twice?

gearce
(GRC)

LANG MEY YER LUM REEK

The future depends on what we do in the present.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 10th Mar 2008 10:22
Hi there!

OK! I give up but, as I have said,

Quote: "I would find it hard to believe that nobody has downloaded the media file and ran the programme."


If I may borrow part from a quote by TDK_Man elsewhere in these forums

Quote: "It's not the thanks I'm after, it's more a case of the fact that after all the work I did writing the code snippet,"


and, as I wrote in one of my postings,

Quote: "My DBClassic programming skills are on a continual learner level so I'd like to hear from you if you can offer a different (not necessarily better) way of writing any part of any of the programmes."


any comments ... constructive or otherwise ... would be appreciated.

Anyway!

gearce
(GRC)

LANG MEY YER LUM REEK

The future depends on what we do in the present.
Zen Master
16
Years of Service
User Offline
Joined: 6th Mar 2008
Location:
Posted: 10th Mar 2008 18:49
I'll give it a run when i get home from work! Looks good

"Face it, if crime didnt pay there would be very few criminals."
Laughton Lewis Burdock
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Mar 2008 23:45
Hello,

I tried out your card game. It plays and looks very nice. I went through your code and saw that it is pretty well organized and commented very well, however, there are a couple of areas that you could eliminate some redundancy and improve performance.

I'll just write in generalities. From what I can understand the basic flow of the program is to read in the card images, ultimately assign them a number from 1 to 52, shuffle them and store them in an array, pick them and have the player bet, determine their numeric value based on the card number, check if the player wins or loses... Is that about right?

Ok, one optimization you could include, would be to have a second array that stores the point value of the card as they are being loaded in. Maybe something like points(CardNum)=Nx+2 . That way it will always revolve around in your For Nx=0 To 12 loop and assign the same cards in each suit the same point value so you don't have to caclulate it later. Which brings me to
checkvalue:
Get rid of this procedure. There's no need for that kind of conditional and loop repetition. If you haven't handled the card values using the points() array then you can determine a card value with a simple formula:



Is there any way you can rewrite your shuffle routine? Mainly the conversion to string, the sorting then reconversion back to a number. If you can just sort/randomize the numbers from the start, you eliminate the function calls to the conversion functions (like val() or left$() right$() ) and additional variables.

Enjoy your day.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 11th Mar 2008 01:54 Edited at: 11th Mar 2008 01:59
To Zen Master and Latch

Thanks for taking the time to look at and comment on the game.

Latch

In general, yes.

Regarding your other comments, very interesting. I think I understand what you are saying and will certainly give it a go.

gearce
(GRC)

LANG MEY YER LUM REEK

The most severe test of friendship is whether it will stand a loan.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 11th Mar 2008 07:24
Hi there!

I have posted the update here instead of overwriting the first post so that people can compare the two and still offer any feedback.



Whether there can still be improvements I don't know. I have picked up ideas and bits and pieces from various postings in the forums and, if you read through the programme, you'll probably recognise something that you contributed to the forums.

Thanks!

gearce
(GRC)

LANG MEY YER LUM REEK

The most severe test of friendship is whether it will stand a loan.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Mar 2008 07:56
Wow, you made a lot of changes! I just noticed something else that's no big deal but will reduces a bit of code. In setup, you can replace



with



and remove the line



Good job!

Hey, why don't you enter the DBC challenges? It looks like you have some good ideas and you might learn a couple of tricks here and there - plus everyone helps each other out with their entries usually.

Enjoy your day.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 11th Mar 2008 09:52
Thanks Latch

This was by TDK_Man

Quote: "Re: [DBC] Acey Ducey Card Game
« Reply #6 on: December 21, 2007, 05:14:08 AM »"


at

http://www.computechtenerife.com/forum/index.php/topic,84.0.html

As you say ...... no big deal. Think I'll leave as is.

Thanks again.

gearce
(GRC)

LANG MEY YER LUM REEK

The most severe test of friendship is whether it will stand a loan.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 13th Mar 2008 03:50
Hi there!

Now to update the card programmes ... yet again ... in my Merlin's Magic Puzzles series.

gearce
(GRC)

LANG MEY YER LUM REEK

The most severe test of friendship is whether it will stand a loan.
gearce
17
Years of Service
User Offline
Joined: 18th Dec 2006
Location: ex SCOTLAND, now MELBOURNE, Australia
Posted: 20th Mar 2008 04:46
Hi there!

Getting there slowly but surely.

gearce
(GRC)

LANG MEY YER LUM REEK (If your fire place is smoking and your are warm, you are likely to live long and happy)

No one can make you feel inferior without your consent.

Login to post a reply

Server time is: 2024-11-25 03:04:15
Your offset time is: 2024-11-25 03:04:15