See the top rated post in this thread. Click here

Page 2 of 2 FirstFirst 12
Results 14 to 23 of 23

Thread: VBA Code For Blackjack

  1. #14


    Did you find this post helpful? Yes | No
    Quote Originally Posted by Norm View Post
    That will not be true for quite some time.
    Try it.

  2. #15


    Did you find this post helpful? Yes | No
    It's mostly true, but not completely - yet. Claude 3.7 is far ahead of 3.5

  3. #16
    Random number herder Norm's Avatar
    Join Date
    Dec 2011
    Location
    The mote in God's eye
    Posts
    12,832
    Blog Entries
    59


    Did you find this post helpful? Yes | No
    Yes, it's mostly true as measured by numbers of applications as most applications are trivial. Most everything you see on the I'Net is trivial.
    "I don't think outside the box; I think of what I can do with the box." - Henri Matisse

  4. #17


    Did you find this post helpful? Yes | No
    Very good point

  5. #18
    Random number herder Norm's Avatar
    Join Date
    Dec 2011
    Location
    The mote in God's eye
    Posts
    12,832
    Blog Entries
    59


    2 out of 2 members found this post helpful. Did you find this post helpful? Yes | No
    Funny one: "AI tool tells user to learn coding instead of asking it generate the code" "Generating code for others can lead to dependency and reduced learning opportunities," says Cursor AI.

    https://www.tomshardware.com/tech-in...erate-the-code
    "I don't think outside the box; I think of what I can do with the box." - Henri Matisse

  6. #19


    Did you find this post helpful? Yes | No
    I finally got GitHub Codepilot to do something useful. I had some code to do screen capture in Windows, modify the image in an image buffer, and write either the original or modified image to a file.

    I asked Claude 3.5 to add a function that would read in a BMP file and modify my class values appropriately.

    It created a function that I was able to compile, and it did read a BMP file which I was able to write out to a new BMP file to check to verify that the image was properly read. However, the new code was confused about the extra image buffer, never wrote any code to resize the buffer, and incorrectly set the image height to a positive value. In BMP (bitmap) images, a negative height value in the header indicates that the image data is stored top-down (from the top row to the bottom), rather than the usual bottom-up orientation. It took me an hour to get the AI code to work properly.

    This reinforces my impression that the AI is good at cribbing from existing code on GitHub to do common tasks, but it has difficulty understanding new tasks. I tried to get it to write code for common gambling games, but the results are usually unsatisfactory. It always stores cards values as an arrays of integers. Many of the important projects that I have use bits to store card values or board positions. This allows a compact representation and parallel processing by bitwise operators. When I ask Claude about my bitwise code, it is usually clueless as to what my functions are doing.




  7. #20


    Did you find this post helpful? Yes | No
    Quote Originally Posted by OnlineAP View Post
    This reinforces my impression that the AI is good at cribbing from existing code on GitHub to do common tasks, but it has difficulty understanding new tasks.
    Yeah that is how LLM's work. They are essentially a hyper-advanced search engine that looks through training data taken from the internet.

    If you want to do something incredibly niche then a broad-based AI isn't likely to be helpful.

    But for 99.9% of use-cases this is irrelevant. The machine code I learned as a child is largely obsolete, notwithstanding the fact there are still multiple use-cases based on analysis of system architecture and increased micro-performance. This is essentially the same: AI prompting is just a higher level language and people can use it much faster and more productively than they could with a lower level language.
    Last edited by Archvaldor; 03-18-2025 at 02:11 AM.

  8. #21


    Did you find this post helpful? Yes | No
    I'm a developer and am just getting into writing Blackjack software -- mostly to re-learn coding as I'm a bit rusty since my time at one of the Big4 was several years ago. It seems like the bitwise operations would be significantly faster for large BJ sims than other data structures. Very curious!! (quick dive down the rabbit hole https://stackoverflow.com/questions/...-cards-in-bits ) -- I'm sure Norm has thought about this more than he would like.
    Last edited by JesterCW; 03-19-2025 at 07:33 AM.

  9. #22


    Did you find this post helpful? Yes | No
    Just use uint8 type for cards? Would be easier and possibly use fewer instructions. Also LUT’s are your friend.

  10. #23


    Did you find this post helpful? Yes | No
    Quote Originally Posted by JesterCW View Post
    I'm a developer and am just getting into writing Blackjack software -- mostly to re-learn coding as I'm a bit rusty since my time at one of the Big4 was several years ago. It seems like the bitwise operations would be significantly faster for large BJ sims than other data structures. Very curious!! (quick dive down the rabbit hole https://stackoverflow.com/questions/...-cards-in-bits ) -- I'm sure Norm has thought about this more than he would like.
    For a single deck, you can encode as many cards as you want into one 52-bit integer (leaving 12 bits of a 64-bit integer unused). This encoding isn't that very useful for BJ, since you typically don't care about suits and you usually have more than one deck.

    But if you want to encode a 7-card poker hand and hash it quickly, bit encoding is quite efficient and powerful. I uploaded a fast hash function for a 7-card poker hand which does a perfect hash of any hand to values from 0 to 133,784,560.

    https://github.com/MentalBlok/mhash/tree/main

    AI Copilot can write a simple guess as to what the code is doing, but it wasn't able to suggest any functional improvements.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. David Kuvelas Breaks The Blackjack Code
    By Zaal in forum The Disadvantage Forum
    Replies: 25
    Last Post: 03-26-2019, 12:56 AM
  2. MGP BJ CA Source Code now available on GitHub
    By MGP in forum General Blackjack Forum
    Replies: 8
    Last Post: 03-14-2017, 04:20 PM
  3. Damon: BlackJack Code
    By Damon in forum Blackjack Main
    Replies: 2
    Last Post: 09-30-2001, 12:11 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

About Blackjack: The Forum

BJTF is an advantage player site based on the principles of comity. That is, civil and considerate behavior for the mutual benefit of all involved. The goal of advantage play is the legal extraction of funds from gaming establishments by gaining a mathematic advantage and developing the skills required to use that advantage. To maximize our success, it is important to understand that we are all on the same side. Personal conflicts simply get in the way of our goals.