Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options user 18535

This challenge is generally based upon, related to, or simulates a game or some portion of one.

0
votes
Ruby, 100 bytes ->a{%w(^2.*4$ 6$ ^6 6 5$ 5 4$ ^1*$ 3$ 4 2$ 1$ .).index{|b|/#{b}/=~([1,*a,4].map{|c|a.count(c)}*'')}} Try it online! How it works: Count occurrences of every number in the array, …
answered Sep 25 '18 by G B
0
votes
Ruby, 29 bytes ->n{0until"#{n+=n%3}"!~/3/;n} Try it online!
answered Mar 8 by G B
13
votes
hard_coded class hard_coded: def __init__(self): self.money = 0 self.round = 0 def play_round(self, did_i_win, amount): self.money += 500 self.round += 1 if did_i_win == 0: …
answered Nov 23 '17 by G B
14
votes
Ruby, 22 19 bytes ->x,y{390[(x-y)%9]} Input: ASCII code of the 2 characters. Output: 1 for allies, 0 for enemies. How it works: Get the difference between the 2 numbers modulo 9, use a bitmask (3 …
answered Mar 13 '17 by G B
1
vote
Ruby, 21 bytes ->a,b,x,y{b-y>6*x-=a} Try it online! Worked around the boring solution, saved a byte and called it a day.
answered Sep 27 by G B
3
votes
Ruby, 126 bytes ->l,w{(/(_|^)..(_|$)/!~s=w*?_)&&!!s.chars.uniq[12]&&/__|^_|_$|(_.*)\1/!~s.gsub(/(.)_\1/,'\1').chars.map{|x|l.grep(/#{x}/)}*?_} Try it online!
answered Apr 17 by G B