Card Sharks Odds Program
01-03-2016, 08:19 PM
Post: #1
 Eddie W. Shore Senior Member Posts: 1,034 Joined: Dec 2013
Card Sharks Odds Program
The game show Card Sharks may have long been off-air except for reruns on GSN or BUZZR (or even finding videos on YouTube), the game show is still popular. It is a simple game involving a standard deck of 52 cards. The object is to predict whether the next card is higher in rank or lower in rank than the preceding card. In Card Sharks, aces always count as high. Along with aces, twos are very desirable, while eights are the worst cards in the deck.

Quick Synopsis: Each player works on his/her own deck of cards. The first two games have 5-card hands while the third, if needed has only 3. A player got control if they won (usually) a survey-type toss up question. A game is won when a hand is completed or wins the sudden-death question. Winning 2 games won the match for the champion. The champion got to play Money Cards, where a seven card hand was dealt in two rows of 3 and one final card. The player then placed bets on whether the card was higher or lower, at even odds. The last bet had to at least half of the player’s bankroll.

The program CSODDS tracks the odds of whether the next card is higher or lower. CSODDS assumes a 52 card deck (no jokers). All entries are numerical, hence:

Jacks = 11
Queens = 12
Kings = 13
Aces = 14

You are asked if you want to continue after each card. The program accounts for the number of cards in each deck.

Code:
EXPORT CSODDS() BEGIN // Card Sharks Odds // Jan 3 2016 EWS // Standard deck of 52 cards LOCAL L6,C,L,H,K,R; L6:=MAKELIST(4,X,1,14,1); L6(1):=0; WHILE ΣLIST(L6)>0 DO INPUT(C,"Next Card","Card:", "J=11 Q=12 K=13 A=14"); IF L6(C)≠0 THEN L6(C):=L6(C)-1; //L:=ΣLIST(SUB(L6,1,C-1))/ //ΣLIST(L6); //H:=ΣLIST(SUB(L6,C+1,14))/ //ΣLIST(L6); L:=0; FOR K FROM 2 TO C-1 DO L:=L+L6(K); END; H:=0; FOR K FROM C+1 TO 14 DO H:=H+L6(K); END; L:=L/ΣLIST(L6); H:=H/ΣLIST(L6); R:=52-ΣLIST(L6); PRINT(); PRINT("CARD: "+C); PRINT("ODDS NEXT CARD IS"); PRINT("HIGHER: "+H); PRINT("LOWER: "+L); PRINT("CARDS USED: "+R); WAIT(0); ELSE MSGBOX("CARD N/A"); END; // Continue? K:=1; CHOOSE(K,"Continue?", {"Yes","No"}); IF K==2 THEN RETURN; END; END; END;

Complete blog post: http://edspi31415.blogspot.com/2016/01/t...harks.html
 « Next Oldest | Next Newest »

 Messages In This Thread Card Sharks Odds Program - Eddie W. Shore - 01-03-2016 08:19 PM

User(s) browsing this thread: 1 Guest(s)