9

I decided to delve deeper into this question to discover exactly how effective certain strategies would have on your win percentage. This led me to this Stanford Computer Science project that pits students' individual UNO strategies against each other.

This particular UNO simulator has some issues that I have corrected:

  • A proper pseudo-random number generator (PRNG-Mersenne Twister)

  • Support for 2-15 players

  • Scoring for wins instead of points

  • Proper rules implementation of initial special cards

  • Hhandling of draw cards when going out.

I opted not to add a "catch"/bluff mechanic when playing Wild-Draw4, so those can only be played when you don't have a matching color.

I have implemented some basic strategies that you will be playing against:

  • Play random legal

  • Play most color

  • Play most point

  • Play highest rank in most color

  • Call random

  • Call color I have

  • Call color most

  • Call points most

These strategies will face off in 100,000+ games multiple times to get a Confidence Interval (CI) for how effective the strategy is. (I am open on direction of how to accomplish this best. Should it be a 4-player game, with 2 copies of the strategy seated non-adjacent to each other (ABAB)?)

So: what is your Uno strategy? Be specific: I'm going to write a program to execute your strategy, and since computers are dumb like me, instructions need to be specific. (If they are not, I will post comments for you to clarify)

Things to think about in your answer:

  • What card do you play next? Do you try to get down to one color or number, or always keep as much variety as possible in your hand? If you have a pair of 0's and a 9, do you play the 9 to reduce your point count, or play a 0 to keep up some variety in your hand? Do you play Skip, Reverse, Draw Two, Wild, and Wild Draw Four early or late, or does it depend on how many cards other people have?
  • What do you do if you must change color? Do you call a color with the most cards, most points, least variety in ranks? Do you think about what opponents might have, or only consider your own hand?
  • Does your strategy change if someone is very close to winning the entire match, i.e. somebody's close to 500 points? How close to 500 do they have to be for you to change how you play?
  • Does your strategy change if you're losing the hand? How do you decide if you're losing? (Do you start ditching the high-point cards like Wild and Draw Two?)

Don't worry about answering all of those questions, but if you change your play depending on circumstances around the table, please mention it in your answer. Being precise helps me program a strategy that matches what you do, but if you cannot, just give me a general idea and I will post pseudo code of what the computer will do.

Don't worry about having the absolute best answer. I will program your strategy, and edit your answer to show its actual win-rate against other strategies.

9
  • Special thanks to @PaulMarshall who gave me a nice wording of the question.
    – user1873
    Oct 10, 2013 at 15:19
  • One thing I do is try to peg back the leader, which can involve being nice to my immediate neighbours. in the ABAB seating arrangement this means I'd be helping to attack myself! I suggest playing three or four strategies against each other and varying the seating order and start player. I'll have a go at putting together an answer later - I'm interested to see whether it actually gives much of an advantage over play random!
    – tttppp
    Oct 13, 2013 at 8:57
  • @tttppp, I am not sure what you mean by "helping to attack myself." I chose 4-player ABAB seating for a reason. I suspect that 4-player is the most common number of players. 2-player suffers from special card Reverse having no meaning. 3-player ABB suffers from always being adjacent to an opponent (since I suspect 4+ players is more common) which might make certain strategies more powerful than they would be IRL. As for not using ABCD seating order, but instead using 2 copies of each strategy, that was becuase seating order does have an effect on win percentages. [...]
    – user1873
    Oct 13, 2013 at 14:39
  • 1
    Good to hear that random call/play is terrible though. I didn't think there was much skill in Uno!
    – tttppp
    Oct 13, 2013 at 15:37
  • 1
    Did you ever make any progress on this? I don't see any updates on how any of the strategies did...
    – Michael
    Feb 24, 2018 at 23:21

3 Answers 3

1

I play the largest number I can and save my draws, skips, and reverses for when they can be used against a winning opponent. I really don't worry about number variety. However, I try to keep a low number of high value cards in my hand, namely reverses, wilds, and skips, in that order, so if someone manages to win I don't give them too many points.

call color: No Strategy (color i have?)

play: 
if hand has X or more Special Cards (SC), 
    play SC(if possible): priority Reverse, Wild, Skip, (Wild Draw-4, Draw-2), 9-0
else if opponent has Y or fewer cards
    if opponent next and hand has Draw-2 or Skip (or Wild Draw-4)
        play Draw-2, Skip, (or Wild Draw-4)
    else if opponent last and hand has Reverse and (Draw-2 or Wild Draw-4)
        play Reverse
    else
        play 9-0, Draw-2, Skip, Reverse, (Wild, Wild Draw-4)
else
    play 9-0, Draw-2, Skip, Reverse, (Wild, Wild Draw-4)
2
  • Some clarification: you say you save draw, skip, reverse to be used against a winning opponent (What constitutes winning, fewer cards, or more points than anyone else but under 500)? Then you say you keep a low number of high value cards, how many 2,3,4? Which is higher priority when you have 2 special cards, a Blue9 or BlueReverse?
    – user1873
    Oct 10, 2013 at 16:23
  • I have added some pseudo code to clarify some points. The default behavior as you explained it is to play the highest point card, then Special cards. Priority is left to right always, so if you have a Draw-2 and Reverse in the same color, you will play the Draw-2. (Wilds played as a last resort). I need values for X & Y, and I assumed you wanted to reduce point cards over attacking a winning player (assumed cards in hand defines winning). Made some other assumptions if the winning player isn't adjacent to return to default behavior.
    – user1873
    Oct 10, 2013 at 17:32
1

Getting the excuses out of the way early: I don't play much Uno at all, and when we do play we typically aim to win a hand, rather than keeping score over several hands. My strategy doesn't take any account of how near to 500 a player is, but presumably you should, as in the optimal Pig strategy.

I aim to get rid of high value cards, but keep a wild card for the end. I also included a 'panic' strategy for when I've been hit with a Wild Draw-4.

One interesting feature is that I occasionally choose to draw a card rather than play a wild card. I'm not sure whether you're allowed to do this according to the official rules, but we allow it.

Notation:
P - Previous opponent
N - Next opponent
O - Opposite opponent
M - Me
C(X) - The number of cards in player X's hand
min(C) - The number of cards in the leading player's hand

Call:
If I don't only have black cards left:
    Filter out colours I don't have
# Vaguely try to annoy other people
Name the one I have seen the most of so far (including my current hand)
Tie break by colour I have most of, then most recently played
If this is the first turn and I've only been dealt black cards, then pick red because it's my favourite.

Play:
If min(C) <= C(M) / 2 and min(C) < C(M) - 3:
    # I'm about to be trounced - throw away high points
    Play +4, change colour, +2
    If C(P) > C(O):
        Play change direction, skip a turn, 9-0
    Else:
        Play skip a turn, change direction, 9-0
Else if I have more than one black card left:
    # Try to save a black card for the end
    Play +4, change colour
Else if I have more than one +2 or C(N) < 3:
    # Very occasionally try to save a +2 in case there's one left over on top of the deck
    Play +2
Play skip turn, +2, change direction, 9-0, +4
If min(C) > 2 and min(C) > C(M) - 1:
    # I've got a wild card, and there's not much chance I won't get to play it
    Choose to draw a card
Play change colour

Additional 'strategies' that presumably aren't relevant in the AI tester:
If I play my second to last card call "Uno".
If an opponent fails to do this then point it out at the appropriate moment.
6
  • The official rules allow drawing when you have a legal play (Renegging). The initial UNO simulator doesn't actually even check of you make legal plays, but it comes with a tester app that considers not making a legal play an error. I have corrected this so the simulator plays with the official rules, with the exception of the "catch" mechanism for playing WildDraw4 (which I chose not to implement).
    – user1873
    Oct 13, 2013 at 18:54
  • @user1873 I intended that to be the code for when I have some cards that don't go, and a wild card that I want to save. If I have multiple wild cards I should play them in either the block labelled"I'm about to be trounced" or the block labelled "try to save a black card for the end". Let me know if you want me to check your code (or if you're using a documented rules engine I might be able to code it for you?)
    – tttppp
    Oct 20, 2013 at 2:06
  • Having thought about it a bit I realised that the language isn't the main barrier to coding an ai player, it's the interface that I'd need to know. Anyway, I'm happy for you to do it, I just thought my pseudo code might be easier for me to interpret!
    – tttppp
    Oct 20, 2013 at 2:22
  • I will code it up, I was just trying to point out some (possible errors) in your code. The interface only requires two functions, Play() returns the index of the card you will play next (-1 means draw). Callcolor() returns an enum that represents on of the 4 colors (wilds are considered to not have a color). The buggy one linked in the OP will show you what else you have access to (I can add additional info if you need it). The problem I see is that you said your rules flow top to bottom, left to right. Your second to last rule has you playing all cards except wilds (should I comment clarify)
    – user1873
    Oct 20, 2013 at 3:43
  • The second to last rule is only meant to play those cards if they're actually valid. Looking through I've been a bit vague on how to proceed if none of the cards in an if block are valid. I think in those cases the execution should try the next else block. More complicated than I gave it credit for though!
    – tttppp
    Oct 20, 2013 at 7:18
0

I don't know whether you're still running your experiment, but lately I've been trying various strategies for the phone-based version of Uno that I have and one that I've been doing is, when the color is C and I have X cards of C and Y cards of another color, D, if Y is greater than X, I go ahead and switch. It seems like it increases my opportunity of a string of cards being played versus staying in the same color and getting stuck earlier, assuming the color doesn't change on its own.

4
  • Can you expand this so that it's a more-complete strategy of what you do and when? Deciding when to change your color is an important part of the game, but what do you do the rest of the time? Apr 19, 2014 at 21:49
  • I don't have a fully-fledged strategy, but basically, my question is along the lines of, "If the color is red and I have 3 red cards and 3 green cards, one of which matches the current number", am I better off playing red or green? My immediate impulse is to stick with the color we're on, but I can see the flip-side. Either way, you're on a color that you have cards for. If the value of N were 1, you're facing having to change color either way. Apr 19, 2014 at 21:51
  • The question is asking for complete (or complete-ish) strategies; as it stands, this is an incomplete answer. Can you take a little time and answer the other parts of the question? Also, the other answers here give a decent idea of what to think about. Don't worry about having a provably-correct strategy, just fill in the rest of the parts of the question with the plays you tend to do when those situations come up. Apr 19, 2014 at 21:55
  • 1
    Your color strategy seems to bring up something that I haven't seen anybody mention - playing colors that you know the next player (probably) doesn't have because they drew the last time that color was up to them.
    – Michael
    Feb 24, 2018 at 23:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .