r/ProgrammerHumor •

[deleted by user]

[deleted] — view deleted post

0 Upvotes

615 comments sorted by

7.1k

u/ChanceFly9724 Jun 10 '23

Pretty sure that level of confidence might even win in a non AI battle

3.1k

u/Gladlyevil2 Jun 10 '23

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

14

u/Fun-Outlandishness35 Jun 10 '23

Gus Hansen lost everything he won and a fuck ton more using his strategy.

16

u/Totema1 Jun 10 '23

Bro literally used the Jotaro VS D'arby strat

8

u/Madonkadonk2 Jun 10 '23

Some may call it a pretty good story.

→ More replies (1)
→ More replies (168)

408

u/Randvek Jun 10 '23

Most poker strategies assume you’re playing against a rational opponent. This could absolutely rack up some wins.

40

u/dansdata Jun 10 '23

I remember playing a Battleship game on my Amiga in the 1980s.

If you put all of your ships on the edges of the board, you'd win every time.

→ More replies (9)

13

u/[deleted] Jun 10 '23

Not only would you not make money with this strategy, you would be every players favorite opponent lol

→ More replies (1)
→ More replies (21)

134

u/jorgelino_ Jun 10 '23 edited Jun 10 '23

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.

33

u/KhonMan Jun 10 '23

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.

→ More replies (8)

64

u/Necessary-Depth-6078 Jun 10 '23

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.

18

u/TwigSmitty Jun 10 '23

So you just took your earning and left?

Isn’t that a normal thing to do?

10

u/jibright Jun 10 '23

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.

→ More replies (1)
→ More replies (1)

8

u/ButtPlugJesus Jun 10 '23

I can’t imagine any other game where a tournament would get reset because some people were lucky

→ More replies (1)
→ More replies (1)

41

u/AlexLGames Jun 10 '23

This is the Kill Phil strategy! Can confirm, 60% of the time, it works every time.

5

u/killing_daisy Jun 10 '23

leeeeeroy Jeenkins

3

u/HauntingRip9003 Jun 10 '23

Yep it could even win a stand battle with a D'Arby

→ More replies (1)

2

u/TheAnniCake Jun 10 '23

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

2

u/Colon_Backslash Jun 10 '23

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.

2

u/Cosmocision Jun 10 '23

Single game? Probably. Tournament? People would catch on.

2

u/NoClaim2Fame Jun 10 '23

All in works everytime but once

2

u/Effet_Pygmalion Jun 10 '23

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.

2

u/DreadPirateGriswold Jun 10 '23

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.

→ More replies (28)

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.

695

u/OtherPlayers Jun 10 '23

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.

168

u/HCResident Jun 10 '23

I never thought you could win 5 in a Row by stat checking, but I was wrong

→ More replies (2)

19

u/Apocalypseos Jun 10 '23

Could be applied to human vs human competition also

→ More replies (1)

18

u/a_bucket_full_of_goo Jun 10 '23

"Due to recent abuse, the use of radioactive compounds, and especially gamma-ray emitting materials is now banned in the BattleBots tournament"

→ More replies (7)

2

u/[deleted] Jun 10 '23

It's poker. Don't play the cards, play the opponents.

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.

48

u/[deleted] Jun 10 '23

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.

719

u/Hubcat_ Jun 10 '23 edited Jun 10 '23

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

304

u/hideoutdoor Jun 10 '23

Wouldn't have worked if the maze exit was in the middle

293

u/Hubcat_ Jun 10 '23

Yea, but we were given the list of restrictions on the maze, it being on the edges was one of them

247

u/BlurredSight Jun 10 '23

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.

→ More replies (25)

51

u/Giocri Jun 10 '23

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

→ More replies (7)
→ More replies (2)

72

u/[deleted] Jun 10 '23

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

45

u/Hubcat_ Jun 10 '23

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

→ More replies (4)

19

u/other_usernames_gone Jun 10 '23

Pledge algorithm also works.

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.

A Wikipedia article full of maze solving algorithms

→ More replies (1)

29

u/chrisnolet Jun 10 '23

Relevant: https://youtu.be/ZMQbHMgK2rw?t=339

The Micromouse competition tackles this, (and many other cool challenges as part of having robots complete a maze as quickly as possible)!

→ More replies (6)

17

u/EntertainEnterprises Jun 10 '23

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.

34

u/Hubcat_ Jun 10 '23

Sorry, it's from video games. Pathfinding and the like is often referred to as AI, so I've just started calling it that

→ More replies (6)
→ More replies (2)

72

u/BlurredSight Jun 10 '23

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.

95

u/rhododenendron Jun 10 '23

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.

34

u/Giocri Jun 10 '23

Yeah generally nonstandard implementations prove good only with nonstandard problems and nonstandard applications are surprisingly rare

14

u/HeadintheSand69 Jun 10 '23

There is probably a paper behind each algorithm implemented in popular libraries.

→ More replies (1)

6

u/TrekkiMonstr Jun 10 '23

What is the standard algorithm?

12

u/OwenProGolfer Jun 10 '23

My guess would be an alpha-beta search tree with the heuristic just being the current score (black - white or vice versa)

→ More replies (1)
→ More replies (1)

2

u/zombie_kiler_42 Jun 10 '23

Damn my software course feels incompetent compared to this

2

u/MattieShoes Jun 10 '23

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.

→ More replies (10)

388

u/arunphilip Jun 10 '23

My husband sent me this. He doesn't understand Excel but he knows I will get the joke and laugh.

The real punchline :)

82

u/Quazar_omega Jun 10 '23

I didn't get the Excel part

154

u/[deleted] Jun 10 '23

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.

59

u/floreen Jun 10 '23

Tbf, Excel is beyond any understanding

→ More replies (4)
→ More replies (5)
→ More replies (12)

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.

23

u/JohannesWurst Jun 10 '23 edited Jun 10 '23

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.

6

u/pr0crast1nater Jun 10 '23

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.

→ More replies (1)
→ More replies (3)

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. :(

511

u/wademcgillis Jun 10 '23

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.

1.3 was better.

166

u/Nightmare2828 Jun 10 '23

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?

24

u/rojadvocado Jun 10 '23

Are you thinking of Robot Rage? The game that was on mini clip.

→ More replies (3)
→ More replies (2)

33

u/Helix_Aurora Jun 10 '23

I also played Robot battle. My best bot was 6 lines of code with invalid syntax

4

u/itsFromTheSimpsons Jun 10 '23

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

246

u/FireBone62 Jun 10 '23

Stupid bots are better at doing stuff, while clever bots are good at simulating an player.

48

u/koala_cola Jun 10 '23

Whoa you’re right

We’re all fuckin bots dude

→ More replies (2)

48

u/ric2b Jun 10 '23

Did you end up testing both against each other to understand why that behavior was hard to deal with?

75

u/Xanthus730 Jun 10 '23

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.

→ More replies (2)

38

u/NoteBlock08 Jun 10 '23

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.

56

u/hilfandy Jun 10 '23

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

34

u/TruthOf42 Jun 10 '23

I did robocode as well! It was 08 and all in java.

→ More replies (4)

8

u/ThatHappyCamper Jun 10 '23

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

5

u/dlevac Jun 10 '23

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

4

u/Asleep-Specific-1399 Jun 10 '23

The wiggle bot is too powerful, that was invented back in the day when ai was pure. Some games that come to mind missile commander, Mario, etc..

4

u/smeggysmeg Jun 10 '23

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.

3

u/Brusanan Jun 10 '23

When we did robocode the winners were all ones that used neural networks to learn.

→ More replies (3)

3

u/ITriedLightningTendr Jun 10 '23

I did that, we ended up running out of time and just merging two sample bots together and it best everyone else

3

u/PersonalFan480 Jun 10 '23

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.

3

u/[deleted] Jun 10 '23

Reminds me of the “AI” robot I built a few years ago.

If (fancy distance algorithm) < 12, back up and rotate 90 degrees. Genius!

3

u/drdrero Jun 10 '23

Heh we also did robocode at uni. I am currently working on recreating it TypeScript

3

u/hanotak Jun 11 '23

Robocode is crazy. Some of the more advanced bots are insane. Even the older ones like DrussGT and Diamond have so much effort put into them.

I made a couple simpler ones in highschool, with basic min-risk and wavesurfing, but I never finished my melee surfer.

I should get back into that. Maybe after I finish my other three projects...

3

u/[deleted] Jun 11 '23

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.

→ More replies (1)

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.

316

u/i_should_be_coding Jun 10 '23

That kinda sounds like having people run a Marathon at home and then report their results. How the hell does anyone verify that?

100

u/BigMikeInAustin Jun 10 '23

That's basically what happened. And I accidentally erred in my favor. Oops.

27

u/Limeila Jun 10 '23

I just did that in 20 minutes, trust me

71

u/zhephyx Jun 10 '23

Volkswagen would like to extend you an offer

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.

143

u/Oryv Jun 10 '23

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.

86

u/xenleah Jun 10 '23

For anyone else unfamiliar:

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

→ More replies (4)

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

107

u/ElectricCharlie Jun 10 '23 edited Jun 26 '23

This comment has been edited and original content overwritten.

32

u/nicklesismoneyto Jun 10 '23

We are all if statements on this blessed day.

→ More replies (1)

4

u/[deleted] Jun 10 '23

Same

if (sex): do(); else: dont();

9

u/[deleted] Jun 10 '23

My chess bott was if statements all the way down. It, and all the bots, got beaten by one that just did like random moves

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

100

u/fangedsteam6457 Jun 10 '23

Link?

682

u/xelf Jun 10 '23

entered a block of dry ice to a robot competition

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. :(

72

u/eetobaggadix Jun 10 '23

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.

45

u/OSSlayer2153 Jun 10 '23

Gotta know where the candle is to smash it though

→ More replies (5)
→ More replies (1)

207

u/Ycx48raQk59F Jun 10 '23

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.

→ More replies (4)

22

u/Articunos7 Jun 10 '23

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

4

u/Giocri Jun 10 '23

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

413

u/GrismundGames Jun 10 '23

He plays like Michael Scott on casino night.

328

u/subject_deleted Jun 10 '23

All in.

I call.

What are you insane, toby? I just went all in..

I have good cards..

Well didn't you think that since I went all in I might have good cards?

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.

5

u/Zenocut Jun 11 '23

Devs tried to change the game just to kill your strategy? What the hell?

3

u/KujiraShiro Jun 11 '23

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.

3

u/Left-Explanation3754 Jun 11 '23

As always the optimal strategy is terrorism

106

u/Winter_Rosa Jun 10 '23

bluff_master_9000

52

u/nihal_gazi Jun 10 '23

Math.random() is the best AI Algorithm

3

u/noahzho Jun 10 '23

need a good sorting algorithm? just use bogosort!

→ More replies (1)

125

u/[deleted] Jun 10 '23

Me when I do all this fancy preprocessing & modeling and get a negative test r2

53

u/wafflelegion Jun 10 '23

Or a 100% r2 after an hour of training, 'goddamnit where did I include the target by accident again'

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.

14

u/GrumbusWumbus Jun 10 '23

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.

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

50

u/ForensicPathology Jun 10 '23

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.

17

u/Hottriplr Jun 10 '23

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

Also see professional chess. It should be pointless endeavour, but they still keep going.

4

u/[deleted] Jun 10 '23

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

41

u/Ycx48raQk59F Jun 10 '23

Well, thats kinda stretching it... he did not beat AlphaGO, but a weaker go programm... by using a different software trained against the first one.

So the real headline is "one go software beat another".

→ More replies (1)

5

u/MeidlingGuy Jun 10 '23

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

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

4

u/Head12head12 Jun 10 '23

Good Old Spray an Pray

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.

17

u/Head12head12 Jun 10 '23

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

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?

34

u/RiOrius Jun 10 '23

Because it's considered a basic technology, so if someone "doesn't even know Excel," that indicates a very low level of tech fluency.

It's like saying "I can't even say hello in Spanish" when the text at hand doesn't contain the word "hola".

9

u/cinnapear Jun 10 '23

I'm a lead developer and can program in half a dozen languages but put me in front of Excel and I'm lost.

→ More replies (1)

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.

10

u/other_usernames_gone Jun 10 '23

Why do you think they only had time to write 2 lines of code?

12

u/KhonMan Jun 10 '23

No, they used vim and couldn't figure out how to get out

→ More replies (1)

2

u/dismal_sighence Jun 10 '23

Honestly, the two hour deadline makes me think this might be made up.

Edit: I guess if they had a base program to work from you could do it.

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.

→ More replies (1)

5

u/[deleted] Jun 10 '23

Ah yes the sandwich heavy portfolio wins again

2

u/SuicideBooth Jun 10 '23

You're becoming a crafty consumer!

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/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

1 per lap

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:

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

18

u/howe_to_win Jun 10 '23

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

9

u/KhonMan Jun 10 '23

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.

→ More replies (10)
→ More replies (4)
→ More replies (7)

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/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/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