]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
UNO!: early exit when checking if W+4 was legal
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 8 Dec 2010 11:54:45 +0000 (12:54 +0100)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Wed, 8 Dec 2010 11:54:45 +0000 (12:54 +0100)
Exit as soon as we find a card that reveals that the W+4 was not a valid
move.

data/rbot/plugins/games/uno.rb

index 6a0562789e463f4d9056e6c2acd4a3134e386e75..e6a7ea189e554ef6a526ec89592930ccc0364292 100644 (file)
@@ -498,6 +498,7 @@ class UnoGame
     lp.cards.each do |c|
       if c.color == @last_color and not c.special?
         legal = false
+        break
       end
     end
     if legal