Quote: VladPutin
You accept SD/DD blackjack for your betting system challenge? If so I might take you on after some research.
I might accept that bet with the caveat that I will be reshuffling after every hand.
I just blocked them too. Life is too short to engage with people who want to argue that the Earth is flatQuote: MichaelBluejayNo, and since you failed the reading comprehension test, now I'm blocking you.
Quote: VladPutinSounds like you reject blackjack because you're afraid of real math. You're specifically picking games with high HE to make it impossible for betting systems to beat the house edge.
And then you claim betting systems are "completely useless".
You, sir, have just committed a "bait and switch".
The fact that betting systems can not overcome your high HE games is not equivalent to "completely useless" and "makes no difference", iirc those are your own words. The bait and switch here is you're trying to claim they "makes no difference" because they can't over come your high HE games. But that's not what "makes no difference" actually means. It means it does not change the EV.
And that is where you're wrong.
That's why you only take high HE games in your challenge, because you're scared of real math.
If the HE is thin enough, a dent from the betting system can actually turn the EV positive.
According to CBJN, MGM has a 0.19% HE double deck, Paris 0.26% 6D, Aria 0.19% DD, Bellagio 0.20% DD, Caesars 0.26 6D etc etc.
All with thin edges that can be beaten without card counting, merely on the results of previous hands.
TLDR you're a coward hiding behind high house edge games with your challenge while using the fact nobody took your challenge to claim a logical fallacy.
link to original post
Pardon me for asking, but are you willing to describe your SD/DD blackjack "system" in some detail?
If you are, then it can be simulated.
If you aren't, then how does anyone tell the difference between "just using the system" and card counting?
Quote: camaplAm I the only one who learned PASCAL?
link to original post
No - that was the standard language at UC-Berkeley in my day (early 1980s) for everything in the non-engineering Computer Science degree except assembly language programming (of course) and operating systems (which used C). This includes having to write a compiler in Pascal.
Quote: ThatDonGuy
Pardon me for asking, but are you willing to describe your SD/DD blackjack "system" in some detail?
If you are, then it can be simulated.
If you aren't, then how does anyone tell the difference between "just using the system" and card counting?Quote: camaplAm I the only one who learned PASCAL?
link to original post
No - that was the standard language at UC-Berkeley in my day (early 1980s) for everything in the non-engineering Computer Science degree except assembly language programming (of course) and operating systems (which used C). This includes having to write a compiler in Pascal.
link to original post
When people talk about a betting system, they assume Martingale, but that is not all. I developed a betting system based on blackjack card counting, but cannot test it. Here it is:
Consider a 2-deck blackjack shoe game. We play simultaneously two-hand when the HiLo true count (TC) is greater than +1. Otherwise, we play one-hand. We flat bet all the way on each hand. Can you help simulate my system?
Quote: teliotI just blocked them too. Life is too short to engage with people who want to argue that the Earth is flatQuote: MichaelBluejayNo, and since you failed the reading comprehension test, now I'm blocking you.
link to original post
To be fair, he was arguing for a simplistic version of “counting” based on whether previous hands were won or lost in blackjack.
Maybe, but my Challenge page states:Quote: unJonTo be fair, he was arguing for a simplistic version of “counting” based on whether previous hands were won or lost in blackjack.
link to original post
(1) Games are roulette, craps, or baccarat (i.e., not blackjack)
(2) Challenge available only to system sellers
(3) Counting systems are disallowed
(4) Possibly more things that he missed would be revealed by his subsequent posts, which I didn't read
This is one reason the Wizard stopped offering his own challenge. People can't even read the damn rules.
Quote: MichaelBluejayMaybe, but my Challenge page states:Quote: unJonTo be fair, he was arguing for a simplistic version of “counting” based on whether previous hands were won or lost in blackjack.
link to original post
(1) Games are roulette, craps, or baccarat (i.e., not blackjack)
(2) Challenge available only to system sellers
(3) Counting systems are disallowed
(4) Possibly more things that he missed would be revealed by his subsequent posts, which I didn't read
This is one reason the Wizard stopped offering his own challenge. People can't even read the damn rules.
link to original post
Yeah I’m not arguing with you. Was just reacting to I’m being characterized that the earth is flat.
Got it. But actually, I wouldn't put it past him.Quote: unJonYeah I’m not arguing with you. Was just reacting to [him] being characterized that the earth is flat.
link to original post
Quote: MichaelBluejayMaybe, but my Challenge page states:Quote: unJonTo be fair, he was arguing for a simplistic version of “counting” based on whether previous hands were won or lost in blackjack.
link to original post
(4) Possibly more things that he missed would be revealed by his subsequent posts, which I didn't read
link to original post
He basically just said you were "hiding behind" high house edge games and not willing to take on low house edge games where the system can dent the EV. He was proposing blackjack games with ~0.2% House edge. He also called you the "C word" lol
I don't accept blackjack because:Quote: IWannaBeAPHe basically just said you were "hiding behind" high house edge games and not willing to take on low house edge games where the system can dent the EV. He was proposing blackjack games with ~0.2% House edge. He also called you the "C word" lol
link to original post
(1) Blackjack can be beaten, with card-counting. (The rules disallow card-counting, but as we've seen, people don't read the rules.)
(2) Coding and debugging takes 20x longer than roulette, craps, or baccarat.
Also, the challenge terms state that the game will use *common* Vegas rules. -0.2% BJ games are pretty rare, I'd call that *exceptional* Vegas rules, not *common* Vegas rules.
Calling someone a c**t seems worthy of suspension, but whatever, I've just blocked him.
Quote: MichaelBluejay
(1) Blackjack can be beaten, with card-counting. (The rules disallow card-counting, but as we've seen, people don't read the rules.)
link to original post
Bruh you look like you don't know how to read either. Either that or you're ignorant of the math of the games you claim to know. Nobody said anything about card counting.
In blackjack previous wins are negatively correlated with future wins, and vice versa. That's a fact. That has nothing to do with card counting. Assuming ofc using perfect basic strategy.
Oh, I should have figured. Because often when I reject a challenger for whatever reason (or refuse to code someone's idiotic idea of a supposed winning betting system), they call me a coward.Quote: IWannaBeAPhaha I meant he said "Coward" lol
link to original post
I realize I didn't elaborate on why the terms specify common game rules and not exceptional rules: My challenge offers a whopping 10 to 1 odds. That means a system that has a lousy 10% chance of winning in a casino would be a good bet for my challenge since I'm paying 10-1. No one would consider a system that loses 90% of the time to be a winning betting system, but such a losing system could beat my challenge with the 10-1 payoff.
The requirement that a system must win ≥11 out of 20 tests with each test being 200,000 rounds is based on the edge of the games I allow. An exceptional game (like some promo) with a much lower house edge could have +EV in my challenge, even if it's a worthless losing system in a casino.
Interesting that many of us came via Fortran. I first wrote in Fortran in 1974 to study the UK single charts; the program took in a wad of cards, which included the data, and punched out the updated "file" onto cards and a printout of this weeks chart. The other program I remember was the "Game of Life" using "sparse arrays". In those days you sat at a card punch machine typing in your program.
The first programing language I learned was Basic. In 12th grade (1974/75) I would get excused from French Class to go to the one and only teletype our high school had, that was connected to the district's mainframe computer. We would code using yellow punch tape so that the whole program could be saved. In those days the big program we worked on was an array-based version of Star Trek, where you had to use trigonometry to figure out the angle to fire a missile at the Klingons. We'd move one array location at a time towards the base for refueling, or avoid colliding with stars, as we went in search of Klingon battle cruisers to fight. Next up was programming a landing game, where we could choose our planet and its gravitational field was fixed, and we had to land our spaceship using individual directions towards firing the retro-rockets, with a fixed fuel supply. I tell you, those games played incredibly slowly over a teletype were just as much fun for us then as anything I've seen since. In 1975 our little club took a field trip to LA College where we were shown a computer that could play chess. With gratitude to my French teacher.Quote: charliepatrickI first wrote in Fortran in 1974 to study the UK single charts; the program took in a wad of cards, which included the data, and punched out the updated "file" onto cards and a printout of this weeks chart. The other program I remember was the "Game of Life" using "sparse arrays". In those days you sat at a card punch machine typing in your program.
Consider a 2-deck blackjack shoe game. When the HiLo true count is greater than +1, we play simultaneously two-hand. Otherwise, we play one-hand. On each hand, we flat bet one unit all the way until the cut card.
Using Wizard’s basic strategy to play a Hit-17 surrender game with a 1.5-deck penetration, can you help simulate the house edge?
Quote: IWannaBeAPQuote: ThatDonGuyI do my share of simulations, and I use Visual C#, which is part of Microsoft Visual Studio, which you can download for free.
link to original post
can you share an example of a simulation you did?
link to original post
It's hard to show Visual C# code because of the way it is implemented, but here is the main "loop" code for craps - specifically, pass line betting with 3/4/5x odds:
Note that this code is simplified somewhat to make it easier for people not familiar with the language to read it - for example, I will use "N = N + 1" instead of "N++" here
The letter L following a number indicates it is a "long" (i.e. 64-bit) number
R is a "Random" variable; R.Next(n) returns an integer from 0 to n-1 inclusive
long NumComeouts = 0L;
long Winnings = 0L;
int Die1, Die2;
int Point;
int Roll;
Die1 = R.Next(6) + 1;
Die2 = R.Next(6) + 1;
Point = Die1 + Die2;
if (Point == 7 || Point == 11)
{
// Natural
Winnings = Winnings + 1;
}
else if (Point == 2 || Point == 3 || Point == 12)
{
// Craps
Winnings = Winnings - 1;
}
else
{
if (Point == 4 || Point == 10)
{
OddsBet = 3;
}
if (Point == 5 || Point == 9)
{
OddsBet = 4;
}
if (Point == 6 || Point == 8)
{
OddsBet = 5;
}
// Roll until you roll your point number or a 7
Roll = 0;
while (Roll != Point && Roll != 7)
{
Die1 = R.Next(6) + 1;
Die2 = R.Next(6) + 1;
Roll = Die1 + Die2;
}
if (Roll == Point)
{
// One advantage of 3/4/5x odds is, all wins pay 7 (1 for the original
// pass line bet, plus 6 for the odds bet)
Winnings = Winnings + 7;
}
else
{
// Remember to subtract both the pass line bet and the odds bet
Winnings = Winnings - (OddsBet + 1);
}
}
NumComeouts = NumComeouts + 1;
if (NumComeouts % 100000L == 0L)
{
// Output the number of comeouts and the amount of winnings here
}
Roll = R.Next(3600000) / 100000;
Roll = (Roll / 6) + (Roll % 6) + 2;
Quote: teliotThe first programing language I learned was Basic. In 12th grade (1974/75) I would get excused from French Class to go to the one and only teletype our high school had, that was connected to the district's mainframe computer. We would code using yellow punch tape so that the whole program could be saved. In those days the big program we worked on was an array-based version of Star Trek, where you had to use trigonometry to figure out the angle to fire a missile at the Klingons. We'd move one array location at a time towards the base for refueling, or avoid colliding with stars, as we went in search of Klingon battle cruisers to fight. Next up was programming a landing game, where we could choose our planet and its gravitational field was fixed, and we had to land our spaceship using individual directions towards firing the retro-rockets, with a fixed fuel supply. I tell you, those games played incredibly slowly over a teletype were just as much fun for us then as anything I've seen since. In 1975 our little club took a field trip to LA College where we were shown a computer that could play chess. With gratitude to my French teacher.
I started on FORTRAN with punch cards and the only output device was a line printer. I wrote a checkers game but for every move you made you had to punch a new card and run it through the card reader. The line printer would print a whole new board for every move. It was very slow and rather impractical, but that is all we had back then.
Why wouldn't you use the built-in RNG? Most modern Javascript implementations use Xoroshift128+, which is supposedly superior to Mersenne Twister.Quote: charliepatrickI use Javascript for my simulations. As has been said you need to ensure you have coded the RNG correctly
link to original post
These are the best pages I could find that compare modern PRNG's:
• Chris Wellons (programmer)
• xor... developer
• PCG developer (a bit outdated)
Quote: VladPutinBruh you look like you don't know how to read either. Either that or you're ignorant of the math of the games you claim to know.
link to original post
Personal insult. Three-day suspension.
To respond to an earlier post, I code in C++ and write my own code. Nothing off the shelf. The only code I didn't write is a Mersenne Twister RNG. I also try to write looping programs for a closed-form analysis, wherever I can, but some games, they are simply are not appropriate.
To respond to another earlier post, my first language was BASIC, which I learned in high school in, I belive, 1982. I also learned Fortran and Pascal in college. Also knew my way around a Unix mainframe pretty well.
Thank you, Wizard. I think the bigger transgression was that he reportedly called me a coward, but either way.Quote: WizardPersonal insult. Three-day suspension.
Do you think you might look into any of the newer PRNG's which are reportedly faster and have better statistical quality, like xoroshiro and PCG (as per my post above yours)?Quote: WizardThe only code I didn't write is a Mersenne Twister RNG.
. . . • Legacy Group (Math.Random / java.util.Random, ThreadLocalRandom, SecureRandom, SplittableRandom)
. . . • LXM (based on LCG)
. . . • Xoroshiro/Xoshiro
It's interesting that SecureRandom is in the "legacy" group, because I think it's the only one that's a CSPRNG (cryptographically-secure). I think that none of the more modern PRNG's that Java now provides are CSPRNG.
I wrote my own video poker analyzer 25 years ago. I was constantly finding bugs by comparing hand frequencies against a commercial video poker program. I would write scripts to look for errors in each of the roughly 3M starting hands and then decide which class of errors I would tackle next. I had code that worked for non-wild games, but the code broke when I added a joker. Same thing when I went to handle double jokers, quick-quads, etc.
I guarantee that if you solve a few games that really interest you, you will gains skills that will transfer to other problems. It will also help you recognize beatable games. Ed Thorpe's calculations weren't that difficult or sophisticated. His real genius was in sensing that he could make significant improvements to basic strategy by understanding the effects of card removal. I imagine he learned a lot about the problem as he was writing his programs. You don't learn as much from reading a result from someone else (which may not even be correct).
Quote: Mental
I guarantee that if you solve a few games that really interest you, you will gains skills that will transfer to other problems. It will also help you recognize beatable games. Ed Thorpe's calculations weren't that difficult or sophisticated. His real genius was in sensing that he could make significant improvements to basic strategy by understanding the effects of card removal. I imagine he learned a lot about the problem as he was writing his programs. You don't learn as much from reading a result from someone else (which may not even be correct).
link to original post
Every good. I don’t program complicated things myself but would like to simulate some blackjack card counting. I’ve used several online simulation programs to do it but haven’t been able to obtain any consistent results. There are commercial softwares to buy but they are not flexible enough for me to develop. This is really a headache. Is there some way to collaborate with a programmer?
"Emscripten is an LLVM/Clang-based compiler that compiles C and C++ source code to WebAssembly, primarily for execution in web browsers."
I develop the C++ code and compile emscripten under cygwin, but it works in ubuntu or whatever. Emscriptem replaced PNACL, which was a big pain in the tuckus to use.
I was using Algol and Fortran in the 70's and I was forced to use Fortran again in the1990s. I would hate to do any of my own programming in Fortran.
I assume this is what gordonm888 means by looping -- looping over all possible deals.
Quote: MentalTo analyze video poker, you just analyze the best strategy of all 8,000 or so nonequivalent deals and then take the weighted average HE. There is no RNG involved in calculating the HE for video poker. That is what I do in my program and I can do it 1.6 seconds, including generating a strategy. This is an exact result. A MC sim would be slow and inexact.
I assume this is what gordonm888 means by looping -- looping over all possible deals.
link to original post
8000? There are 134,459 "unique" hands in a standard 52-card deck.
Quote: Ace2Please define unique
link to original post
A "unique" hand is one that is different from the other unique hands even when you switch the suits around. For example, if you have a hand, and then make all of the spades in that hand hearts and all of the hearts in that hand spades, those two are the same unique hand.
Another way to put it: replace spades with "Suit A," hearts with "Suit B," clubs with "Suit C," and diamonds with "Suit D"; the hands formed by assigning spades, hearts, clubs, and diamonds to Suit A through Suit D in each of the 24 orders are the same unique hand.
Examples:
All four Royal Flushes are a single "unique hand"
All four hands that are four Aces are a single "unique hand"
The hands 2s, 3s, 5h, 8d, 9h; 2d, 3d, 5c, 8h, 9c; 2d, 3d, 5s, 8h, 9s are a single "unique hand" - a suited 2 and 3, a suited 5 and 9 of a second suit, and an 8 of a third suit.
Note that 2s, 2h, 3s, 3h, 4s (2, 3, 4 suited; 2, 3 suited in a different suit) and 2s, 2h, 3s, 3h, 4c (2, 3 suited; 2, 3 suited in a different suit; 4 in a third suit) are two different "unique hands." If the 4 is a heart, it is the same "unique hand" as the one with 4s; if the 4 is a diamond, it is the same "unique hand" as the one with 4c.
There are lots of sites where you can hire programmers for one-off projects, like Upwork, StackOverflow, and Fiverr. You might even be able to find some here. (I'm not available now, sorry, and I'm not the best programmer, anyway.)Quote: acesideIs there some way to collaborate with a programmer?
link to original post
you are really just talking about the number of equivalence classes of hands under the action of the symmetric group S4 on the suits of each hand. And I agree with your result.Quote: ThatDonGuyQuote: Ace2Please define unique
link to original post
A "unique" hand is one that is different from the other unique hands even when you switch the suits around. For example, if you have a hand, and then make all of the spades in that hand hearts and all of the hearts in that hand spades, those two are the same unique hand.
Another way to put it: replace spades with "Suit A," hearts with "Suit B," clubs with "Suit C," and diamonds with "Suit D"; the hands formed by assigning spades, hearts, clubs, and diamonds to Suit A through Suit D in each of the 24 orders are the same unique hand.
Examples:
All four Royal Flushes are a single "unique hand"
All four hands that are four Aces are a single "unique hand"
The hands 2s, 3s, 5h, 8d, 9h; 2d, 3d, 5c, 8h, 9c; 2d, 3d, 5s, 8h, 9s are a single "unique hand" - a suited 2 and 3, a suited 5 and 9 of a second suit, and an 8 of a third suit.
Note that 2s, 2h, 3s, 3h, 4s (2, 3, 4 suited; 2, 3 suited in a different suit) and 2s, 2h, 3s, 3h, 4c (2, 3 suited; 2, 3 suited in a different suit; 4 in a third suit) are two different "unique hands." If the 4 is a heart, it is the same "unique hand" as the one with 4s; if the 4 is a diamond, it is the same "unique hand" as the one with 4c.
link to original post
Quote: ThatDonGuyQuote: Ace2Please define unique
link to original post
A "unique" hand is one that is different from the other unique hands even when you switch the suits around. For example, if you have a hand, and then make all of the spades in that hand hearts and all of the hearts in that hand spades, those two are the same unique hand.
Another way to put it: replace spades with "Suit A," hearts with "Suit B," clubs with "Suit C," and diamonds with "Suit D"; the hands formed by assigning spades, hearts, clubs, and diamonds to Suit A through Suit D in each of the 24 orders are the same unique hand.
Examples:
All four Royal Flushes are a single "unique hand"
All four hands that are four Aces are a single "unique hand"
The hands 2s, 3s, 5h, 8d, 9h; 2d, 3d, 5c, 8h, 9c; 2d, 3d, 5s, 8h, 9s are a single "unique hand" - a suited 2 and 3, a suited 5 and 9 of a second suit, and an 8 of a third suit.
Note that 2s, 2h, 3s, 3h, 4s (2, 3, 4 suited; 2, 3 suited in a different suit) and 2s, 2h, 3s, 3h, 4c (2, 3 suited; 2, 3 suited in a different suit; 4 in a third suit) are two different "unique hands." If the 4 is a heart, it is the same "unique hand" as the one with 4s; if the 4 is a diamond, it is the same "unique hand" as the one with 4c.
link to original post
This concept is standardly called "suit-folding." Which is a shorter way to refer to it.
Quote: MichaelBluejayThere are lots of sites where you can hire programmers for one-off projects, like Upwork, StackOverflow, and Fiverr. You might even be able to find some here. (I'm not available now, sorry, and I'm not the best programmer, anyway.)Quote: acesideIs there some way to collaborate with a programmer?
link to original post
link to original post
Thank you for your information. The Wizard has simulated a lot of blackjack house edges for a given basic strategy. I am wondering if there is such a program for me to download online somewhere.
Quote: WizardQuote: VladPutinBruh you look like you don't know how to read either. Either that or you're ignorant of the math of the games you claim to know.
Personal insult. Three-day suspension.
Now that I served my 3 day suspension for personal insult, I believe it's time for Michael Bluejay to get a 3 day ban as well.
Not only did he start the insults and the flame, but his insults to me are identical to my insults back to him in idea. In other words, I merely copied his insults. Thus I figured if he can say those stuff to me, I can say the same back. Either neither of us get in trouble or both of us get in trouble. Now apparently I got a suspension for saying that, so I request in the spirit of equal rule enforcement, Michael Bluejay gets a 3 day suspension as well.
Regarding details:
Me: "Bruh you look like you don't know how to read either."
This is a response to
Quote: MichaelBluejayNo, and you failed the reading comprehension test.
Me: "Or you're ignorant of the math of the games you claim to know."
This is a response to
Quote: MichaelBluejayGot it. But actually, I wouldn't put it past him.Quote: unJonWas just reacting to [VladPutin] being characterized that the earth is flat.
]
Quote: acesideDo you think it is possible to use Visual Basic for Applications (VBA) in Excel to simulate for the house edge using a certain Blackjack basic strategy to play a billion 2-deck shoes?
link to original post
Absolutely
Here is my JavaScript for basic Baccarat:
function init() {
var par = document.getElementById("par");
var a, b, c, d, e, f;
var player, banker;
var isNatural;
var temp, Number, totalHands = 0;
var bNum = 0, pNum = 0, tNum = 0;
var pEV, bEV, tEV;
var BacShoe = [];
BacShoe[0] = 128;
BacShoe[1] = 32;
BacShoe[2] = 32;
BacShoe[3] = 32;
BacShoe[4] = 32;
BacShoe[5] = 32;
BacShoe[6] = 32;
BacShoe[7] = 32;
BacShoe[8] = 32;
BacShoe[9] = 32;
par.innerHTML = "Starting ..." + "<BR>";
for (a = 0; a <= 9; a++) {
for (b = 0; b <= 9; b++) {
for (c = 0; c <= 9; c++) {
for (d = 0; d <= 9; d++) {
for (e = 0; e <= 9; e++) {
for (f = 0; f <= 9; f++) {
player = getPlayer(a,b,c,d,e,f);
banker = getBanker(a,b,c,d,e,f);
temp = 1;
temp *= BacShoe[a];
BacShoe[a]--;
temp *= BacShoe;
BacShoe--;
temp *= BacShoe;
BacShoe--;
temp *= BacShoe[d];
BacShoe[d]--;
temp *= BacShoe[e];
BacShoe[e]--;
temp *= BacShoe[f];
BacShoe[a]++;
BacShoe++;
BacShoe++;
BacShoe[d]++;
BacShoe[e]++;
Number = temp;
totalHands += Number;
if (banker > player)
bNum += Number;
else if (player > banker)
pNum += Number;
else
tNum += Number;
} //f
} //e
} //d
} //c
} //b
} //a
bEV = (bNum*(0.95) + (totalHands - bNum - tNum)*(-1))/totalHands;
pEV = (pNum*(1.00) + (totalHands - pNum - tNum)*(-1))/totalHands;
tEV = (tNum*(8.00) + (totalHands - tNum)*(-1))/totalHands;
par.innerHTML += "Banker Win: " + bNum + "<br>";
par.innerHTML += "Player Win: " + pNum + "<br>";
par.innerHTML += "Tie: " + tNum + "<br>";
par.innerHTML += "Total Hands: " + totalHands + "<br>";
par.innerHTML += "Banker EV: " + bEV + "<br>";
par.innerHTML += "Player EV: " + pEV + "<br>";
par.innerHTML += "Tie EV: " + tEV + "<br>";
}//init
function getPlayer(a, b, c, d, e, f) {
var player1, banker1;
player1 = (a+b)%10;
banker1 = (c+d)%10;
if (banker1 === 8 || banker1 === 9 || player1 === 8 || player1 === 9) {
return player1;
}
else if (player1 === 7 || player1 === 6) {
return player1;
}
else if (player1 <= 5) {
player1 = (player1 + e)%10;
return player1;
}
else {
return player1;
}
} //getPlayer
function getBanker(a, b, c, d, e, f) {
var player1, banker1;
player1 = (a+b)%10;
banker1 = (c+d)%10;
if (banker1 === 8 || banker1 === 9 || player1 === 8 || player1 === 9) {
return banker1;
}
else if ((player1 === 6 || player1 === 7) && banker1 >= 6){
return banker1;
}
else if ((player1 === 6 || player1 === 7) && banker1 <= 5) {
return (banker1+e)%10;
}
else if (player1 <= 5 && banker1 >= 0 && banker1 <= 2) {
return (banker1 + f) % 10;
}
else if (player1 <= 5 && banker1 === 3 && e != 8) {
return (banker1 + f) % 10;
}
else if (player1 <= 5 && banker1 === 4 && e >= 2 && e <= 7) {
return (banker1 + f) % 10;
}
else if (player1 <= 5 && banker1 === 5 && e >= 4 && e <= 7) {
return (banker1 + f) % 10;
}
else if (player1 <= 5 && banker1 === 6 && e >= 6 && e <= 7) {
return (banker1 + f) % 10;
}
else {
return banker1;
}
}Climate Casino: https://climatecasino.net/climate-casino/
Here is my JavaScript for basic Baccarat, which this extraordinarly sucky message board software has decided to "center" for some reason totally unassociated with my coding.
function init() {
var par = document.getElementById("par");
var a, b, c, d, e, f;
var player, banker;
var isNatural;
var temp, Number, totalHands = 0;
var bNum = 0, pNum = 0, tNum = 0;
var pEV, bEV, tEV;
var BacShoe = [];
BacShoe[0] = 128;
BacShoe[1] = 32;
BacShoe[2] = 32;
BacShoe[3] = 32;
BacShoe[4] = 32;
BacShoe[5] = 32;
BacShoe[6] = 32;
BacShoe[7] = 32;
BacShoe[8] = 32;
BacShoe[9] = 32;
par.innerHTML = "Starting ..." + "<BR>";
for (a = 0; a <= 9; a++) {
for (b = 0; b <= 9; b++) {
for (c = 0; c <= 9; c++) {
for (d = 0; d <= 9; d++) {
for (e = 0; e <= 9; e++) {
for (f = 0; f <= 9; f++) {
player = getPlayer(a,b,c,d,e,f);
banker = getBanker(a,b,c,d,e,f);
temp = 1;
temp *= BacShoe[a];
BacShoe[a]--;
temp *= BacShoe;
BacShoe--;
temp *= BacShoe;
BacShoe--;
temp *= BacShoe[d];
BacShoe[d]--;
temp *= BacShoe[e];
BacShoe[e]--;
temp *= BacShoe[f];
BacShoe[a]++;
BacShoe++;
BacShoe++;
BacShoe[d]++;
BacShoe[e]++;
Number = temp;
totalHands += Number;
if (banker > player)
bNum += Number;
else if (player > banker)
pNum += Number;
else
tNum += Number;
} //f
} //e
} //d
} //c
} //b
} //a
bEV = (bNum*(0.95) + (totalHands - bNum - tNum)*(-1))/totalHands;
pEV = (pNum*(1.00) + (totalHands - pNum - tNum)*(-1))/totalHands;
tEV = (tNum*(8.00) + (totalHands - tNum)*(-1))/totalHands;
par.innerHTML += "Banker Win: " + bNum + "<br>";
par.innerHTML += "Player Win: " + pNum + "<br>";
par.innerHTML += "Tie: " + tNum + "<br>";
par.innerHTML += "Total Hands: " + totalHands + "<br>";
par.innerHTML += "Banker EV: " + bEV + "<br>";
par.innerHTML += "Player EV: " + pEV + "<br>";
par.innerHTML += "Tie EV: " + tEV + "<br>";
}//init
function getPlayer(a, b, c, d, e, f) {
var player1, banker1;
player1 = (a+b)%10;
banker1 = (c+d)%10;
if (banker1 === 8 || banker1 === 9 || player1 === 8 || player1 === 9) {
return player1;
}
else if (player1 === 7 || player1 === 6) {
return player1;
}
else if (player1 <= 5) {
player1 = (player1 + e)%10;
return player1;
}
else {
return player1;
}
} //getPlayer
function getBanker(a, b, c, d, e, f) {
var player1, banker1;
player1 = (a+b)%10;
banker1 = (c+d)%10;
if (banker1 === 8 || banker1 === 9 || player1 === 8 || player1 === 9) {
return banker1;
}
else if ((player1 === 6 || player1 === 7) && banker1 >= 6){
return banker1;
}
else if ((player1 === 6 || player1 === 7) && banker1 <= 5) {
return (banker1+e)%10;
}
else if (player1 <= 5 && banker1 >= 0 && banker1 <= 2) {
return (banker1 + f) % 10;
}
else if (player1 <= 5 && banker1 === 3 && e != 8) {
return (banker1 + f) % 10;
}
else if (player1 <= 5 && banker1 === 4 && e >= 2 && e <= 7) {
return (banker1 + f) % 10;
}
else if (player1 <= 5 && banker1 === 5 && e >= 4 && e <= 7) {
return (banker1 + f) % 10;
}
else if (player1 <= 5 && banker1 === 6 && e >= 6 && e <= 7) {
return (banker1 + f) % 10;
}
else {
return banker1;
}Climate Casino: https://climatecasino.net/climate-casino/
Quote: teliotSo either one can code or they can't.
Exactly. When hiring I never really cared if the person I was hiring new a particular language. A good programmer can program in any language as it is only semantics at that point.
I have even fibbed when applying for jobs saying I new a particular language. If they offered me the job I would be fluent in that language before my start date.
(1) You don't have to assign an HTML object to a variable to refer to it, you can just refer to its ID. This line is unnecessary, works fine without it:
var par = document.getElementById("par");
(2) Arrays can be declared and populated in one line, like this:
BacShoe = [128,32,32,32,32,32,32,32,32,32];
For anyone trying to run the code, here's what you need to do to get it to run:
(1) Add the HTML object, the <script> tag, and the call to the init() function, like so:
<div id=par></div>
<script>
init();
[teliot's code]
</script>
(2) Fix the references to BacShoe[]. The forum software interprets an array argument of "b" in brackets to be the command for "bold", which is why teliot's code suddenly turns bold, and an argument of "c" in brackets as the command for "center", which is why teliot's code suddenly gets centered. Copy and paste the code, and then put in the "b" and "c" arguments everywhere they're missing.
Thanks for providing your code. I almost always learn something new when I see examples of code from experienced programmers.
One quick question: you have this statement fragment in your code:
banker1 >= 0 && banker1 <= 2
Do you actually have to check if banker1 is greater than or equal to zero?
Dog Hand
Quote: DogHandteliot,
Thanks for providing your code. I almost always learn something new when I see examples of code from experienced programmers.
One quick question: you have this statement fragment in your code:
banker1 >= 0 && banker1 <= 2
Do you actually have to check if banker1 is greater than or equal to zero?
Dog Hand
link to original post
No, banker1 >= 0 does not need to be checked.