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
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.
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.
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.
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.
Bookmarks