Skip to content

Commit

Permalink
MOAR randomization \m/
Browse files Browse the repository at this point in the history
  • Loading branch information
chesterbr committed May 22, 2013
1 parent 3626477 commit c5e276e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
--format documentation
--colour
--order random
4 changes: 2 additions & 2 deletions spec/lib/ruby2600/cpu_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
cpu.pc = 0x0000

# Catch unexpected side effects
randomize :a, :x, :y, :n, :v, :i, :z, :c
randomize :a, :x, :y, :s, :n, :v, :i, :z, :c

# Examples wil refer to these values. Add, but don't change!
cpu.memory = []
Expand Down Expand Up @@ -63,7 +63,7 @@

def randomize(*attrs)
attrs.each do |attr|
value = attr =~ /[axy]/ ? rand(256) : [true, false].sample
value = attr =~ /[axys]/ ? rand(256) : [true, false].sample
cpu.send "#{attr}=", value
end
end
Expand Down

0 comments on commit c5e276e

Please sign in to comment.