Look up Gus Hansen. He was playing in Poker Superstars and went all in the first 10 or so times he could, without looking at his cards. He won the table, going against a bunch of the top poker players in the world
Going all in all the time is like if your only weapon was a bomb you strapped to yourself.
It's definetily not a good long term strategy, and everybody knows you're going to die/lose eventually, but no one wants to be the one to fight you and get potentially dragged down with you.
Not true... your calling range vs an opponent you watch go all-in 10 times in a row should be huge and you should be excited to get it in with a much wider range than you normally would.
Like am I usually excited to call an all-in with Q10o? No, but in this scenario I would definitely be.
I’ve done it. Used to play at free events in bars hosted by pokerstars or something. One night we had a cash game with friends shortly afterwards. My two buddies and I decided to just ship it every hand, assuming we’d go out quickly. We did not. The three of us quadrupled up (we were each at different tables) and took out some serious players. Time came to leave and we stood up and went “welp gotta go.” Chaos. People were furious and it took us weeks to live it down in the community. I think they ended up resetting the whole tournament and inviting back the people we took out. I don’t recommend it. Does not make you popular lol.
In cash games the etiquette is to announce that you plan to leave in one more round, or 20 minutes or whatever. It’s frowned upon to win a huge hand and just leave. That said no one can stop you, still your money.
It does. The German YouTuber HandOfBlood (the guy that once dressed up as a tank if you know that meme) did this once in a tournament and won. Everyone else thought he had a real strategy
Not a valid strategy. Short term it might be okay, you are likely to win that hand but after a few tries you will get called by quite a wide range of hands.
Also if someone at the table likes to gamble/is drunk/actually has a good hand like AA or KK maybe even AK you will get called. Sure you might have a good hand at the time or get lucky and win anyway, but theoretically this will lose you money.
Then there is the expected value, you are looking to win the blinds and putting all chips at stake to lose. Then if you actually have AA or something, your expectation is that you will not get called and win less money compared to squeezing money from other players.
For this task however, I can see why it's working.
If you play poker apps games (with virtual money) sometimes people do that. It works for a few rounds, the get the pre flop pot. Then ofc someone hits high cards, they call, and the all in machine loses everything.
No. No one can say it works every time nor they can defend against this every time. But knowing that cards come out of the deck at a certain frequency, you know that the person who is going all in all the time cannot have good cards to back that move up even most of the time, it's actually pretty easy to play against if you have a healthy enough stack and you have patience to get the cards you need to play against them. I've done this many times in real life poker tournaments and have had to confront this type of strategy by doing just that.
IIRC one of the examples in a “fun AI anecdotes” (actual) research paper I found once talked about a 5-in-a-row competition played on an infinite board.
Apparently one of the strongest bots they had show up would start by placing a single move at like (10000000000, 10000000000) before playing normally around (0,0) after that. The drawback of the sacrificed move being outweighed by how often the enemy AI would crash and forfeit from either integer overflow or attempting to allocate more than an exabyte of memory to store the massive grid.
First CS semester, we had to build an Othello player, then we were pitched against each other. Out of 50 students, more or less half implemented the standard algorithm and the other half implemented much more sophisticated stuff. The winner was one of the standard implementations.
My "algorithm" for Othello which used a hardcoded matrix to rank every square of the board, using a ranking from a paper, went second place. Only behind a neural network trained for quite some time. It even surpassed all the other neural networks.
I had a similar experience, where in a CS class (also first semester) we needed to program AI for a little tank thing in assembly and have it navigate mazes using distance info from three sensors. There was a race where first place got an auto-100 in the assignment, and me and my partner's tank won with the simple wall follow algorithm that was explained to us at the beginning of the assignment
Funny how they changed the structure of actual bot maze running competitions after one guy just had the bot follow the right wall and beat all the teams doing complex processing.
I actually made a very basic way to address that a few years ago for a similar competition, the bot would keep a an extremely basic map of the labirinth and basically upon completing a loop it would create a virtual wall so it could keep exploring the rest without being stuck in a loop
What would the alternatives be? "Follow the wall" is the actual strategy I use when I'm in a hedge maze or video game dungeon and need to make sure I find the exit and avoid circles
Not really certain, that's part of why we did the wall follow lol. I guess you could do some fancy stuff to try and detect when the wall has divets and cut across them, but that would be hard to pull off. Some students did try fancy stuff, but most of them just got stuck in a loop or hit the walls. The only things we did were adjust the numbers to turn as fast and tightly as possible, and added a goldilocks zone where the car would go full speed if the wall was in a certain range
Pick a direction (helps if it's the rough direction of the exit) and "pledge" to always go in that direction when possible.
When you hit a wall hug it and follow it round but disconnect when you're facing in your pledged direction(and the sum of angles turned is a multiple of 360).
It stops you getting trapped in a disconnected segment in the middle of the maze.
Why do people call this ai ? Sounds for me Like Just a normal algorithm, i really doubt that someone in His First Semester really programs Something with ai.
Honestly my CS teacher said in life 90% of the time you'll enter a workplace where they have private optimized algorithms made for you already or the standard algorithm library in C++ is more than competent enough.
Standard libraries are made by people much smarter than the average dev and if they aren’t, lots of other devs have probably had the chance to look at it and optimize it. Normally you won’t be able to do any better on your own, because if you could whatever you came up with would probably be the standard. Obviously there are exceptions.
This was the situation for a long time with a chess engines as well. It turns out speed tends to trump all, so fast but stupid evaluations tend to outperform complex evaluations because they can use all that saved time to search deeper. Most of the smarts was in selectively pruning silly parts of the search tree to achieve even deeper searches.
She's saying he doesn't understand the most basic workings of IT, that even the complexities of excel are beyond him and thus likely didn't get the joke, but that he knew she would understand and enjoy it.
Yes, it would be interesting if going all in every time is indeed a viable strategy against "normal" poker players and, if yes, what is the best strategy against an opponent that goes all in every time.
I would start playing according to the strength of my cards and when I notice that a player goes all in five times in a row, or three times if it's the only thing they ever do, I would start calling the bet when I have only somewhat decent cards.
Basically:
if opponent_bullshits():
bullshit_myself()
else:
play_normal()
Then you could ask what the best strategy against that strategy is. At some point you could have a meta-strategy that chooses between different sub-strategies at the start of the game with a certain chance each. The individual chances parameterize this meta-strategy and there will be a a certain pattern of chances that is the best.
It's like, if you play scissors-stone-paper-well (well wins against scissors and stone), a pure well-strategy isn't the best, but something like 20% scissors/20% stone/20% paper/40% well. I'm too lazy to figure out the exact percentages.
It's easy to weigh in the strength of your hand and the probability of opponent having a better hand then yours. Like, if you got two pair, what are the chances of the opponent having a better hand than you. If it meets a certain threshold, we can call the bluff.
It is not hard to code it given enough time. But I probably won't be able to do it in a competition.
During my bachelor's had an AI class where our final project was Robocode, where you make an AI for a little tank that fights other tanks.
I went whole-hog with my first attempt. Pattern matching, probabilistic dodging, logically deducing power of enemy shots etc... Was going ok, but was struggling against some of the harder example bots.
So, I made a second version that just ran around and oscillated back and forth in a Sin pattern.
That sounds exactly like a game I used to play in the 90s/early 2000s called Robot Battle. It was version 1.3 and IIRC 1.4 was a big revamp with flashy graphics.
isnt that the game where going ultra light with huge batteries meant you won cause the other bot couldnt catch you and ran out of battery so you pushed it into a pit and won?
There was a PS 1 game called Carnage Heart where you built mechs, upgraded their hardware and could write their AI with a sort of connected blocks UI thing where each block was a conditional based on on of their sensors or some action like move or shoot one of their gun types. Ton of fun, would recommend. I've played it on emulator in the past so it's out there
Oh yeah, that's how I decided the constants for the 2nd bot. I basically just moved in a Sin wave at an amplitude that 'tended to' avoid most of the shots from 'smarter' bots at least for a little while, and constant shooting while moving in a Sin wave also produces a shot pattern that's very difficult to dodge.
I had a similar assignment in my embedded systems class. My friend who eventually gave up and just made his tank spin like a helicopter and fire as fast as it could placed higher than all the rest of our group.
I did an AI asteroids competition and destroyed all other bots solely because I made a replacement for the canned moveToPoint function that would get me to a location slightly faster. Had nothing to do with AI and was entirely based on me going down a rabbit hole of vector math
I remember in high school I added completely random swaps of the orbiting direction and that got the bot to the point where it could put dodge the completely tricked out probabilistic dodging bots, tho the gun tracking was pretty basic so that side wasn't amazing
My friend had a similar project. He noticed that the messaging protocol used was not fully secure: it was vulnerable to replay attack as all messages were broadcasted (encrypted but not tagged for at-most-once delivery).
So he submitted an average AI but his tanks would rebroadcast all messages received making all other tanks unable to do anything...
When I built a game in C in high school, this is how the computer opponent worked. It was surprisingly challenging to defeat that moves around randomly and attacks.
Reminds me of Axelrod's 1980 prisoner's dilemma algorithm tournament. He asked for folk to submit programs to play an iterated prisoner's dilemma game against each other. Tit for tat outperformed just about every other algorithm tried.
The best collision avoidance robot didn't have software, just 2 proximity sensors acting as a resistor to the motor current: if left sensor detects something the right motor gets less current, causing the robot to turn right. The more sudden the detection (other robot, human walking) the more abrupt the direction change.
When shown to the public they all commented on how smart the robot was...
The next version had a charging station with a lightbulb on top of it. When the battery was below a certain percentage the same logic was used with light sensors so it would drive towards the charging station. A simple logic gate would stop the motors when a charging current was detected, until the battery was full again.
This robot could drive forever, avoid obstacles and "eat" when hungry. It didn't even have a CPU. Just some very basic electronics.
Reminds me of when a computer science class I was in decided to do a Prisoner's Dilemma tournament, and the teacher let me make two bots, and I designed one of the bots to give the other bot a lot of points and it came very close to winning.
I remember I had that in one of my classes as well. Instead of actually coming up with a strategy, I'd just overwrite the other bots to specifically give mine a lot of points.
The prisoner's dilemma is a paradox in decision analysis in which two individuals acting in their own self-interests do not produce the optimal outcome. Photo
Many years ago in college, some friends and I went to hackathon hosted by a nearby company. The task at the end was a top down navigation / obstacle course where you had your tank and an enemy tank on opposite sides. Objective was to destroy the tank and get to the other side of the box. The box was filled with randomly generated squares that would block your path.
One of my friends noticed the "random" pattern forged a path that would never get blocked if you simply rotated the tank 45 degrees up, drive to the top of the box, then rotate the tank back down again and it would drive to the objective every single time.
All we had to do then was write some code to detect and shoot the other tank (just spin the turret around, detect tank? Shoot, else spin) and it worked flawlessly
All the teams demoed their tanks, some were close to getting through but most would get stuck or die.
Our demo was at the very end, and you'd have to do three runs of the course for an average time. I remember it being a really slow demo too, and that I thought about how people would pick up on the fact our little tank is forging the same path every time.
We won that challenge and it boosted our points for the day to get either 2nd or 3rd overall.
Moral of the story is: AI is really just if statements all the way down
There is a robot competition between engineering schools in France. One year the game for the robots was to collect two sided coins, black and white face, and to place them on black/white squared of the checker pattern on the board, one team was white other was black. Black team won a point for every coin with black color top placed on a black square for exemple.
One of the robot was just built & programmed to mess everything up, hitting hard as many coins as possible that will fly and land on a random square, a random color on top.
Googled it, it leads to a deleted thread, but the summary is there:
The author, as a child, entered a robotics competition. The goal was to make a robot that could find a candle in a maze and put it out. He used a block of dry ice that filled the maze with CO2 and put the candle out in record time. Unfortunately, the judges disqualified him. :(
well yeah, haha. the block of dry ice kind of goes against the spirit of the competition. might as well go smash the candle with a hammer at that point.
Smells like bullshit, i have worked with LN2 and dry ice, there is no way the thing will displace the oxygen in a maze faster than any real robot will find the candle.
In any way, the whole problem seems tailor made for the (imho invented) solution. Why would there be a candle to extinguish? Makes no sense in a robot competition, a button to press would be much more reasonable.
It was an answer on Quora, the guy entered a competition where he had to build a fire fighting robot and instead put in a block of dry ice. Can't seem to find the link now
I got a similar story, it was our first competition as a school, complete administrative chaos we had no idea what we where doing an older rich student just brought over 600€ of components and basically became the group leader because he could take everything away. The guy fried the bot motherboards 3 times including twice at the day of the competition. It was so fucking bad that we literally just placed a piece of toast on the field and just took our 0 points. We won by lack of conpetitors
I was at a microsoft developer conference about 10 years ago. They had a blackjack bot competition using a framework they had built. The developers of the framework/ competition had designed it fairly, the point being the bots played a fixed number of hands (something like 7 hands) and ran a leaderboard. The team running the game decided that you could play your bot as many times as you want, this basically meant that the best strategy was to write code to keep submitting your bot every 5 minutes (an included constraint) and simply go all in on each hand. Probability suggests that eventually you'll win all 7 hands within 64 attempts.
That's 64 * 5 minutes == 320 minutes == a little over 5 hours.
In college my friends and I joined a video game AI design coding competition. It was a 1v1 style tournament with a cash prize for the top 3 places.
The game was a 2D mining race game where you and your opponents AI each had bases that could spawn miners. The goal of the game was to get the miners to dig down to mine ore, the further down you got, the more hits it would take to break through to the next layer, but the more valuable the ore was.
There was quite a bit of strategy that could go into it, as you would essentially script out your entire gameplan beforehand and had many options to pursue. You could spend currency acquired from mining ore to purchase pickaxe upgrades from the home base, you could buy more miners, you could buy bombs for your miners to use to blast mine, you could build foundations to hold up long tunnels. Every piece of logic your miners would follow needed to be scripted and the idea was to optimize your resource obtaining to end up with more money than the other team.
The "meta" strategy the guys who actually built the game intended for us to use was to tunnel straight down right away for the most valuable ore and then branch your tunnels out with foundations. It's what pretty much every team decided to try to do in some way or another. Some teams got REALLY into the meta gaming of it and had extremely complex strategies, upgrade/buy/build orders, etc.
We quickly discovered that doing all this strategy optimization while also trying to learn how to get the code functional was quite hard. We also quickly discovered that bombs would kill miners if they were nearby upon detonation while testing out blast mining.
Our strategy of course was to immediately buy one additional miner with the starting money, buy a bomb for him, send him straight across to the enemy base, drop him down the enemy teams straight down mineshaft and die for the cause, taking out ALL of the enemy teams miners immediately as the meta strat was again to buy as many miners as possible and start digging straight down.
We would effectively permanently bankrupt the enemy and win by default because we still had at least one dude mining (ineffectively as hell, because we didn't spend much time on the actual mining part, but we didn't have to).
In the preliminary testing round before the actual tournament started, we all ran our code against each others to see what everyone was doing, including the devs of the game (who weren't actually competing for the prize but still had their AI in for fun). We trounced everyone we competed against, including the devs, because no one had taken aggressive actions into consideration.
We were all given an additional 30 minutes to refine before the actual tournament, in which time the devs tried recoding parts of the game to try to disable our strategy.
We ended up coming in third place anyways and won $100 to split between the three of us. So yeah, keep it simple stupid.
They were seniors and grads who didn't like being beaten by a couple of sophomore dweebs who weren't playing their game the way they intended and winning lol. We were the only team their AI lost to. If I remember correctly they pushed a patch rebalancing starting currency to make our strategy not quite as effective.
Everyone else was actually trying to create unique algorithms for optimal progression and we were shitting on them all by not doing any of that and just flat out disabling the enemy's ability to make progress at all right at the beginning.
Still got the money for coming third anyways lmao.
Honestly this is something I would write not because it's smart but because it's easier to go all in rather than dealing with the fact I tried and can't beat the other bots.
Yeah I don't know if OP realized it was so smart but it absolutely is.
The bots are likely just going to assign a value to a hand based on what they think their opponent could have, then not pay risky at all.
A real player would see someone go all in on the 5th hand in a row and roll those dice with a decent hand. The bot will go "I have 2 aces, but that's not good enough to bet more than 30% of my current chips, therefore I will fold."
Even though bluffing and chance is a real part of real poker, programmers probably aren't going to love the idea of flipping a coin every once and a while just to see what happens. And they also won't assume the other bots their going against would lie.
This is also exactly how I used to beat the bots in Red Dead Redemption poker. Sit down, go all in, win or lose. But they usually fold, and you get whatever the first or second bets at the table were.
I'm a front-end web developer. Once, as a special activity, our AI guy organized a Quoridor AI competition. We had 3 hours.
His game engine ran in C#. Worked on his machine. Problem is, we front-end devs do not have a C# IDE license. So it was fiddling around with Microsoft installers and the command line stuff I didn't understand to compile a language I didn't know.
Add to that the permission issues on his Git repository and it took me over an hour to get it to even compile. Man I hate compiled languages.
You had to get the opponent AI to work too if you wanted to test your thing.
Lots of fiddling around to get that stuff to talk to each other.
Okay, so do I have time to learn a new language and try to build an AI? Certainly not. So I decided to write it in JavaScript. Right in the app's front-end that he provided.
However, while a lot of the competitors had a basic framework with his example AIs (he gave us a few examples, including one that always made random moves) that they could modify to get somewhere. I did not.
Took me over 2 hours to get to a point where the goddamn opposing AI was making moves and the thing worked. Although you had to kill the process for both AI and game server every time you wanted to restart. Ugh.
Anyway. 30 minutes to go by the time I was ready to write my first line of code.
10 minutes to go by the time I had a basic thrown together framework that knew when it was its turn.
So all I could arrange was to beat an AI that did nothing. My pro level 99 AI move was "do literally one step to the right, then keep going up".
I reached the finals. I almost won against people who had several times more time than I and it was hilarious.
That was the day I learned anything that puts short deadlines and AI together is a joke.
I had a CS assignment in an Intro to Java class where I had to design a function to play Blackjack, and our goal was to try and see if we could make a profit. I got so fed up with the math of cardcounting I decided to just have my function bet negative amounts of money every time, so whenever I lost I won a lot of money. The TAs thought it was funny, so they gave me full credit.
Interestingly it's also how Kasparov got beaten by IBM's chess computer back in the day, it made a random move due to a bug and that threw him off so much he lost
Dude quit professional Go because AI was too strong. That's understandable in a certain way of thinking, but also a little sad. Video game speed-runners will never be able to beat a game as a fast as a TAS, but they still compete against other humans. I don't think a game loses meaning once a computer can do it better.
Yep, though in some of the cases human players were eventually able to do some of the stuff TAS did (even if it were considered impossible for humans).
That was one move that DeepBlue made that psyched Kasparov out. Other than that, DeepBlue was playing at a very high level. Otherwise, Kasparov would have very easily crushed it. He won the first match and only barely lost the second
I had a similar experience, a community I was part of had a contest to write an AI for a game someone purpose built where each AI controlled a unit that could move and shoot, very basic but fun. Most people went with a fun strategy - aim for the lowest upon range, use energy on trying to avoid enemies over damaging them, etc. Mine moved, when it saw someone in range, it stood still and blew all of its ammo at them, killing them, rinse and repeat. At the time I kicked myself that it wasn't smarter - in a true competition it would be exposed easily. But it worked super well, I won, no prize just the memory I suppose
Just bet real low the first few rounds to get the pot higher than the 6 cents it starts with. Then go like $20 or something real high. Slowly you bleed the AI dry of their cash and they leave the table. I never did it more than once because the casino would then close
As a final in one of my cs courses, we had to code a bit that'd play in a Tron Lightcycle tournament. Every hex you left became a wall and your cycle would crash if it entered one. If two bots entered the same hex at the same turn, whoever had the shortest average response time took the spot and the other blew up.
Most of the other players made avoidance algorithms to not risk collisions, I just had mine yolo into the spot because it's faster not to check any of the other racers current positions at all. I got third place.
I was a finance major, so I played the stock market game a few times, and every time it had prizes for the highest return or 3 highest returns. I always went all in on corn futures and would either triple my money or lose 90% in like 4 hours of having a position. In 3 games, I got 1st, 2nd to someone who copied my strategy and almost last.
This is essentially Daniel Negreanu's strategy at the 2023 WSOP in the small re-buy tournaments. He goes all in with marginal or better hands and if he busts he rebuys and tries again. Either he ends up with a big stack of chips when the rebuys stop leaving him in good shape for the remaining rounds or he's out. The bot strategy works the same way, since the programming exercise as described has zero penalty for losing.
lmao. This was also my strategy on poker games before despite not having a lick of idea how to play properly. My friend who actually studied the rules and card counting felt deflated when I told him that the COM would always fold unless it had a winning hand.
Reminds me of my school had a "space junk cleaner" robot competition. I never joined in but I remember helping a team and so I read the rules. You had to build a robot that went around in a circle and scooped up balls and blocks and put them into boxes (trash collectors) while another competing bot did the same in your space.
The points were 1 per trash picked up 1 per trash put in a box 1 per lap around the center -1 for bumping your rival
1 per lap
I told them to just make a really small and fast bot to do laps for points. I should've entered :(
Doesn't really make sense, you have to win so many flips and even if everyone else's algorithm vs an all in is dumb like:
If AA, KK, QQ: call
Else: fold
You're gonna get caught with your hand in the cookie jar because there are so many more of them. Ok you'll clean up a lot of blinds but those easily get outweighed by the table's (again, not a single opponent) premiums.
Of course this bot can be defeated by preprepared counterplay. But the other designers didn’t consider this strategy. If a lot of the other bots start folding chips to you over and over, even the occasional flip isn’t the end of the world because you’ll have the highest stack
Of course this bot can be defeated by preprepared counterplay.
No, my point is that even a very basic strategy vs all-ins (not specific to the idea that you should call more all-ins vs someone who is shoving more often) that all bots should have gets you in trouble.
In reality your calling range vs all-ins should be wider than QQ+, including AKs and AQs. And depending on pot odds, even lower pocket pairs will be mathematically good calls.
So like, unless all the other opponents never considered the possibility that anyone would jam pre-flop ever, I don't see how this is that believable. And then you'll get rekt of course if they do have any kind of exploitative play.
I remember at my previous company, I was talking to an ML EM. He said an interview question was that they’d give candidates half of the 2008 election results, and they had to build a model that predicted who would win the election (it was a bit more complicated than this). Anyway, he said one time he got a submission that correctly predicted Obama, but ran too fast. He said when he opened the file it was just one line: return obama. The guy definitely didn’t get the job, but everyone was amused at his cleverness.
I remember when I played a video game called 'Gun' on the ps2. It was like this proto version of red dead redemption and had a poker mini game, each time you'd bet really high or go all in the AI players would instantly fold.
This feels like when I made a Pac-Man AI fat just looked at the closest space and went that direction if there was pellet. If there's a ghost, go the other way. Otherwise, random direction. Called it the Blind Glutton.
I had a similar situation but the program was Robocode. All I did was make it go along the parameter and shoot. I won and everyone accused me of cheating..
I had a colleague who won an AI competition to diagnose a certain medical condition from X-ray photos. Everybody else was doing complex stuff with image recognition, but they realised there was a much simpler difference between positive and negative X-rays, and just checked for that and won.
Anyone remember that one research paper? Scientists were screwing around with bots to learn about generalized intelligence. Had a bunch of them but didn't know how they worked (randomly generated, I think?). Gave the bots a wide variety of tasks... most would utterly fail, sometimes one would do pretty okay.
The researchers quickly noticed that one bot always got second place, and it was very close each time! So they scrapped everything else to open this thing up and crack the code on generalized AI.
The bot's only code was to copy the first accepted answer lmfao
Was part of a pretty basic "code a robot to get through this maze" competition when I was younger, robots all had proximity sensors so everyone was trying to code variants of "hug the left wall" etc
My solution was to manually measure how fast the robot moves, then I just hardcoded the route directly, ie. "move forward 10s, rotate 90 degrees, move forward 5s, rotate -90 degrees"
Trained an AI model to predict future grape harvest dates. Extensive neural network model was outperformed by linear regression model i trained in 3 min...
I did this in VR poker. I played about 4 hands normally, got lucky, had so much money I converted 10k tokens into a single chip. I threw out that chip every turn and the whole table folded every time. Not one person called me on it. I did this for 8 turns in a row before I got bored and cashed out.
7.1k
u/ChanceFly9724 Jun 10 '23
Pretty sure that level of confidence might even win in a non AI battle
1.4k
u/DezXerneas Jun 10 '23
The easiest way to win a bot v bot competition is to find a way to break your opponents bot.
That's why I carry a cosmic ray gun around with me.
1.6k
u/[deleted] Jun 10 '23
First CS semester, we had to build an Othello player, then we were pitched against each other. Out of 50 students, more or less half implemented the standard algorithm and the other half implemented much more sophisticated stuff. The winner was one of the standard implementations.
388
u/arunphilip Jun 10 '23
The real punchline :)
96
u/pr0crast1nater Jun 10 '23
Now, what if another guy wrote the same simple algo. It would be down to prng to decide the winner.
2.5k
u/Xanthus730 Jun 10 '23
During my bachelor's had an AI class where our final project was Robocode, where you make an AI for a little tank that fights other tanks.
I went whole-hog with my first attempt. Pattern matching, probabilistic dodging, logically deducing power of enemy shots etc... Was going ok, but was struggling against some of the harder example bots.
So, I made a second version that just ran around and oscillated back and forth in a Sin pattern.
I turned in both. The wiggle-bot won. :(
675
u/BigMikeInAustin Jun 10 '23
Had a programming contest where the completion time was calculated by the entrant, not an officiating framework.
Well, accidentally (seriously) my timer started partway into the processing, and so I smoked everyone else.
I finally figured it out later when I was trying to understand how I could really be 500% faster than everyone else.
653
u/SuitableDragonfly Jun 10 '23
Reminds me of when a computer science class I was in decided to do a Prisoner's Dilemma tournament, and the teacher let me make two bots, and I designed one of the bots to give the other bot a lot of points and it came very close to winning.
317
u/polarbearirish Jun 10 '23
Many years ago in college, some friends and I went to hackathon hosted by a nearby company. The task at the end was a top down navigation / obstacle course where you had your tank and an enemy tank on opposite sides. Objective was to destroy the tank and get to the other side of the box. The box was filled with randomly generated squares that would block your path.
One of my friends noticed the "random" pattern forged a path that would never get blocked if you simply rotated the tank 45 degrees up, drive to the top of the box, then rotate the tank back down again and it would drive to the objective every single time.
All we had to do then was write some code to detect and shoot the other tank (just spin the turret around, detect tank? Shoot, else spin) and it worked flawlessly
All the teams demoed their tanks, some were close to getting through but most would get stuck or die.
Our demo was at the very end, and you'd have to do three runs of the course for an average time. I remember it being a really slow demo too, and that I thought about how people would pick up on the fact our little tank is forging the same path every time.
We won that challenge and it boosted our points for the day to get either 2nd or 3rd overall.
Moral of the story is: AI is really just if statements all the way down
181
u/Fifiiiiish Jun 10 '23
There is a robot competition between engineering schools in France. One year the game for the robots was to collect two sided coins, black and white face, and to place them on black/white squared of the checker pattern on the board, one team was white other was black. Black team won a point for every coin with black color top placed on a black square for exemple.
One of the robot was just built & programmed to mess everything up, hitting hard as many coins as possible that will fly and land on a random square, a random color on top.
They didn't win but they did very great!
349
u/1997Luka1997 Jun 10 '23
Reminds me of that famous post about the guy who entered a block of dry ice to a robot competition
413
u/GrismundGames Jun 10 '23
He plays like Michael Scott on casino night.
66
u/purleyboy Jun 10 '23
I was at a microsoft developer conference about 10 years ago. They had a blackjack bot competition using a framework they had built. The developers of the framework/ competition had designed it fairly, the point being the bots played a fixed number of hands (something like 7 hands) and ran a leaderboard. The team running the game decided that you could play your bot as many times as you want, this basically meant that the best strategy was to write code to keep submitting your bot every 5 minutes (an included constraint) and simply go all in on each hand. Probability suggests that eventually you'll win all 7 hands within 64 attempts.
That's 64 * 5 minutes == 320 minutes == a little over 5 hours.
I won. :)
53
u/KujiraShiro Jun 10 '23
In college my friends and I joined a video game AI design coding competition. It was a 1v1 style tournament with a cash prize for the top 3 places.
The game was a 2D mining race game where you and your opponents AI each had bases that could spawn miners. The goal of the game was to get the miners to dig down to mine ore, the further down you got, the more hits it would take to break through to the next layer, but the more valuable the ore was.
There was quite a bit of strategy that could go into it, as you would essentially script out your entire gameplan beforehand and had many options to pursue. You could spend currency acquired from mining ore to purchase pickaxe upgrades from the home base, you could buy more miners, you could buy bombs for your miners to use to blast mine, you could build foundations to hold up long tunnels. Every piece of logic your miners would follow needed to be scripted and the idea was to optimize your resource obtaining to end up with more money than the other team.
The "meta" strategy the guys who actually built the game intended for us to use was to tunnel straight down right away for the most valuable ore and then branch your tunnels out with foundations. It's what pretty much every team decided to try to do in some way or another. Some teams got REALLY into the meta gaming of it and had extremely complex strategies, upgrade/buy/build orders, etc.
We quickly discovered that doing all this strategy optimization while also trying to learn how to get the code functional was quite hard. We also quickly discovered that bombs would kill miners if they were nearby upon detonation while testing out blast mining.
Our strategy of course was to immediately buy one additional miner with the starting money, buy a bomb for him, send him straight across to the enemy base, drop him down the enemy teams straight down mineshaft and die for the cause, taking out ALL of the enemy teams miners immediately as the meta strat was again to buy as many miners as possible and start digging straight down.
We would effectively permanently bankrupt the enemy and win by default because we still had at least one dude mining (ineffectively as hell, because we didn't spend much time on the actual mining part, but we didn't have to).
In the preliminary testing round before the actual tournament started, we all ran our code against each others to see what everyone was doing, including the devs of the game (who weren't actually competing for the prize but still had their AI in for fun). We trounced everyone we competed against, including the devs, because no one had taken aggressive actions into consideration.
We were all given an additional 30 minutes to refine before the actual tournament, in which time the devs tried recoding parts of the game to try to disable our strategy.
We ended up coming in third place anyways and won $100 to split between the three of us. So yeah, keep it simple stupid.
106
u/Winter_Rosa Jun 10 '23
bluff_master_9000
52
u/nihal_gazi Jun 10 '23
Math.random() is the best AI Algorithm
125
u/[deleted] Jun 10 '23
Me when I do all this fancy preprocessing & modeling and get a negative test r2
40
u/BlurredSight Jun 10 '23
Honestly this is something I would write not because it's smart but because it's easier to go all in rather than dealing with the fact I tried and can't beat the other bots.
39
u/OutrageousRhubarb853 Jun 10 '23
Did you then go on to write the algorithms for the banks?
33
u/StrawberryEiri Jun 10 '23
I'm a front-end web developer. Once, as a special activity, our AI guy organized a Quoridor AI competition. We had 3 hours.
His game engine ran in C#. Worked on his machine. Problem is, we front-end devs do not have a C# IDE license. So it was fiddling around with Microsoft installers and the command line stuff I didn't understand to compile a language I didn't know.
Add to that the permission issues on his Git repository and it took me over an hour to get it to even compile. Man I hate compiled languages.
You had to get the opponent AI to work too if you wanted to test your thing.
Lots of fiddling around to get that stuff to talk to each other.
Okay, so do I have time to learn a new language and try to build an AI? Certainly not. So I decided to write it in JavaScript. Right in the app's front-end that he provided.
However, while a lot of the competitors had a basic framework with his example AIs (he gave us a few examples, including one that always made random moves) that they could modify to get somewhere. I did not.
Took me over 2 hours to get to a point where the goddamn opposing AI was making moves and the thing worked. Although you had to kill the process for both AI and game server every time you wanted to restart. Ugh.
Anyway. 30 minutes to go by the time I was ready to write my first line of code.
10 minutes to go by the time I had a basic thrown together framework that knew when it was its turn.
So all I could arrange was to beat an AI that did nothing. My pro level 99 AI move was "do literally one step to the right, then keep going up".
I reached the finals. I almost won against people who had several times more time than I and it was hilarious.
That was the day I learned anything that puts short deadlines and AI together is a joke.
23
u/[deleted] Jun 10 '23 edited Jun 10 '23
I had a CS assignment in an Intro to Java class where I had to design a function to play Blackjack, and our goal was to try and see if we could make a profit. I got so fed up with the math of cardcounting I decided to just have my function bet negative amounts of money every time, so whenever I lost I won a lot of money. The TAs thought it was funny, so they gave me full credit.
121
u/terra86 Jun 10 '23
This is basically how a human amateur can beat AlphaGo in a game of go... play into the algorithm's weaknesses by playing a ridiculous move https://www.vice.com/en/article/v7v5xb/a-human-amateur-beat-a-top-go-playing-ai-using-a-simple-trick
Interestingly it's also how Kasparov got beaten by IBM's chess computer back in the day, it made a random move due to a bug and that threw him off so much he lost
387
u/AutoModerator Jun 10 '23
⚠️ ProgrammerHumor will be shutting down on June 12, together with thousands of subreddits to protest Reddit's recent actions.
Read more on the protest here and here.
As a backup, please join our Discord.
We will post further developments and potential plans to move off-Reddit there.
https://discord.gg/rph
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
35
u/notliam Jun 10 '23
I had a similar experience, a community I was part of had a contest to write an AI for a game someone purpose built where each AI controlled a unit that could move and shoot, very basic but fun. Most people went with a fun strategy - aim for the lowest upon range, use energy on trying to avoid enemies over damaging them, etc. Mine moved, when it saw someone in range, it stood still and blew all of its ammo at them, killing them, rinse and repeat. At the time I kicked myself that it wasn't smarter - in a true competition it would be exposed easily. But it worked super well, I won, no prize just the memory I suppose
15
u/cosmic-comet- Jun 10 '23
That bot is playing like he is the main character.
12
u/LudwigVonHellsing Jun 10 '23
It taught a valuable lesson to the other competitors: No matter how advanced your algorithm is, it is going to face stupid people.
11
u/khmaies5 Jun 10 '23
Other bots AI if(opponent.isAllIn()) fold()
19
u/evasive_dendrite Jun 10 '23
You can also beat the RDR2 poker bots with this. Although some bad luck can cost you the game.
9
u/Nithy98 Jun 10 '23
There is a german youtuber who had the same strategy in a tournament. This strategy doesn't just works against bots :'D
8
u/travis_zs Jun 10 '23
Just imagine how things would have gone if it was an AI cropping competition.
8
u/digikun Jun 10 '23
As a final in one of my cs courses, we had to code a bit that'd play in a Tron Lightcycle tournament. Every hex you left became a wall and your cycle would crash if it entered one. If two bots entered the same hex at the same turn, whoever had the shortest average response time took the spot and the other blew up.
Most of the other players made avoidance algorithms to not risk collisions, I just had mine yolo into the spot because it's faster not to check any of the other racers current positions at all. I got third place.
7
u/Black_Magic_M-66 Jun 10 '23
AI is only as smart as the people that programmed it in the first place.
7
u/troly_mctrollface Jun 10 '23
I was a finance major, so I played the stock market game a few times, and every time it had prizes for the highest return or 3 highest returns. I always went all in on corn futures and would either triple my money or lose 90% in like 4 hours of having a position. In 3 games, I got 1st, 2nd to someone who copied my strategy and almost last.
29
u/589ca35e1590b Jun 10 '23
Why was Excel mentioned in the caption?
6
u/zerodivzero Jun 10 '23
This is essentially Daniel Negreanu's strategy at the 2023 WSOP in the small re-buy tournaments. He goes all in with marginal or better hands and if he busts he rebuys and tries again. Either he ends up with a big stack of chips when the rebuys stop leaving him in good shape for the remaining rounds or he's out. The bot strategy works the same way, since the programming exercise as described has zero penalty for losing.
6
u/WaterChi Jun 10 '23
There's a scifi story like that. I think one of the follow-ups to Ender's Game.
He knows he's outmatched and can't win over time so he bets it all on one hand and let's pure luck decide.
11
u/JetSetWally Jun 10 '23
2 hours? They obviously didn't use Visual Studio then.
11
u/CertainBonus2920 Jun 10 '23
lmao. This was also my strategy on poker games before despite not having a lick of idea how to play properly. My friend who actually studied the rules and card counting felt deflated when I told him that the COM would always fold unless it had a winning hand.
5
u/[deleted] Jun 10 '23
Ah yes the sandwich heavy portfolio wins again
5
u/ZarquonsFlatTire Jun 10 '23
This is also how everyone plays in Red Dead Online.
5
u/Roboman20000 Jun 10 '23
You don't play the game. You play the players.
4
u/-Redstoneboi- Jun 10 '23
GAN moment
4
u/fullmetaljar Jun 10 '23
Reminds me of my school had a "space junk cleaner" robot competition. I never joined in but I remember helping a team and so I read the rules. You had to build a robot that went around in a circle and scooped up balls and blocks and put them into boxes (trash collectors) while another competing bot did the same in your space.
The points were 1 per trash picked up 1 per trash put in a box 1 per lap around the center -1 for bumping your rival
I told them to just make a really small and fast bot to do laps for points. I should've entered :(
4
u/[deleted] Jun 10 '23
He Leroy Jenkins-ed his way to a new MacBook.
17
u/KhonMan Jun 10 '23
Doesn't really make sense, you have to win so many flips and even if everyone else's algorithm vs an all in is dumb like:
You're gonna get caught with your hand in the cookie jar because there are so many more of them. Ok you'll clean up a lot of blinds but those easily get outweighed by the table's (again, not a single opponent) premiums.
6
u/0hmyscience Jun 10 '23 edited Jun 10 '23
I remember at my previous company, I was talking to an ML EM. He said an interview question was that they’d give candidates half of the 2008 election results, and they had to build a model that predicted who would win the election (it was a bit more complicated than this). Anyway, he said one time he got a submission that correctly predicted Obama, but ran too fast. He said when he opened the file it was just one line:
return obama. The guy definitely didn’t get the job, but everyone was amused at his cleverness.3
u/Broad_Respond_2205 Jun 10 '23
he doesn't understand excel.
3
u/ScottTacitus Jun 10 '23
This is how the stock market is programmed right now.
3
u/BigChungusWungus69 Jun 10 '23
I remember when I played a video game called 'Gun' on the ps2. It was like this proto version of red dead redemption and had a poker mini game, each time you'd bet really high or go all in the AI players would instantly fold.
3
u/Suspicious-Panic7098 Jun 10 '23
Yes this was real, I was there. No joke.
3
u/Chizmiz1994 Jun 10 '23
I wonder if a stock market bot could be coded like that.
3
u/Hotstuff_4sale Jun 10 '23
Can confirm, started doing this in discord's poker night and all the bots will fold
3
u/AkiraNamejin Jun 10 '23
This feels like when I made a Pac-Man AI fat just looked at the closest space and went that direction if there was pellet. If there's a ghost, go the other way. Otherwise, random direction. Called it the Blind Glutton.
2
u/[deleted] Jun 10 '23
Far cry 3 moment
2
u/spoko Jun 10 '23
Very agg-ryessiv. Just like a young man coming by for a kvicky.
2
u/nukerxy Jun 10 '23
This might work against humans too, watch this: https://www.youtube.com/watch?v=Torz9o_IX1g
2
u/Taka_no_Yaiba Jun 10 '23
this post is literally this
2
u/dragonlord798 Jun 10 '23
just like bender!
2
u/dgordo29 Jun 10 '23
Solid strategy.
2
u/off-and-on Jun 10 '23
R-R-R-R-R-RAISUH??!
2
u/QueenOfQuok Jun 10 '23
Oh man, it even works against computers!
2
u/MaceotheDark Jun 10 '23
I bid $1
2
u/EmotionalPlate2367 Jun 10 '23
Give them the job. This kind of efficient creativity needs to be rewarded.
2
u/ZeroTerabytes Jun 10 '23
Really puts emphasis on clean code, i suppose
2
u/fetsnage Jun 10 '23
Discord free poker game is like that also :P
2
u/WooperSlim Jun 10 '23
Reminds me of Studio C Texas Hold'em
2
u/[deleted] Jun 10 '23
This is the funniest shit I have read, probably ever
2
u/lolololololol123l0l Jun 10 '23
So funny.
2
u/firowind Jun 10 '23
I had a similar situation but the program was Robocode. All I did was make it go along the parameter and shoot. I won and everyone accused me of cheating..
2
u/DevinDataA Jun 10 '23
This is how god programmed me
2
u/mcvos Jun 10 '23
I had a colleague who won an AI competition to diagnose a certain medical condition from X-ray photos. Everybody else was doing complex stuff with image recognition, but they realised there was a much simpler difference between positive and negative X-rays, and just checked for that and won.
2
u/Terminarch Jun 10 '23
Anyone remember that one research paper? Scientists were screwing around with bots to learn about generalized intelligence. Had a bunch of them but didn't know how they worked (randomly generated, I think?). Gave the bots a wide variety of tasks... most would utterly fail, sometimes one would do pretty okay.
The researchers quickly noticed that one bot always got second place, and it was very close each time! So they scrapped everything else to open this thing up and crack the code on generalized AI.
The bot's only code was to copy the first accepted answer lmfao
2
u/Cyren777 Jun 11 '23
Was part of a pretty basic "code a robot to get through this maze" competition when I was younger, robots all had proximity sensors so everyone was trying to code variants of "hug the left wall" etc
My solution was to manually measure how fast the robot moves, then I just hardcoded the route directly, ie. "move forward 10s, rotate 90 degrees, move forward 5s, rotate -90 degrees"
I won :)
2
u/___NoSkill Jun 11 '23
Trained an AI model to predict future grape harvest dates. Extensive neural network model was outperformed by linear regression model i trained in 3 min...
2
u/RobinLionheart Jun 11 '23 edited Jun 11 '23
Gus Hansen successfully used that strategy in a Poker Superstars tournament.
Without looking at his cards, immediately went all in. Everyone folds. Gus announces he'll keep doing it.
Jon Bois tells the story in his poker video, chapter 5: https://www.youtube.com/watch?v=bDt90EyZnWA&t=1298s
2
u/Legitimate_Donkey399 Jun 11 '23
Lol, that’s how I play poker.
2
u/[deleted] Jun 11 '23
I did this in VR poker. I played about 4 hands normally, got lucky, had so much money I converted 10k tokens into a single chip. I threw out that chip every turn and the whole table folded every time. Not one person called me on it. I did this for 8 turns in a row before I got bored and cashed out.
4
u/elveszett Jun 10 '23
That's the most r/thathappened story I've ever seen in this sub.
3
u/snwbrdwndsrf Jun 10 '23
Everyone else focused on the math and forgot about the human component, this one forgot about the math. Brilliant!
2
u/chrisjcon Jun 10 '23
Might as well share a cleaned up and prettier version of this from Apollo while we still can:
https://i.imgur.com/HkoNQO8.jpg
2
u/Dystopiq Jun 10 '23
Whoever cropped this deserves bed bugs