Sha256: 0ef1d30b7929152a146315fa7cc54cfcb4a96d95379daa30055a250a8bfbf5b1

Contents?: true

Size: 261 Bytes

Versions: 31

Compression:

Stored size: 261 Bytes

Contents

MAX = 1000

class Fixnum
  def prime?
    ('1' * self) !~ /^1?$|^(11+?)\1+$/
  end
end

class PrimeChecker
  def is_prime? number
    number.prime?
  end
end

prime_checker = PrimeChecker.new

(10_000...(10_000+MAX)).each do |n|
  prime_checker.is_prime? n
end

Version data entries

31 entries across 31 versions & 6 rubygems

Version Path
adamh-amqp-0.6.3.1 examples/mq/primes-simple.rb
brontes3d-amqp-0.6.4.0 examples/mq/primes-simple.rb
brontes3d-amqp-0.6.4.1 examples/mq/primes-simple.rb
brontes3d-amqp-0.6.4.2 examples/mq/primes-simple.rb
brontes3d-amqp-0.6.4.3 examples/mq/primes-simple.rb
brontes3d-amqp-0.6.4 examples/mq/primes-simple.rb
fotonauts-amqp-0.6.1 examples/mq/primes-simple.rb
fotonauts-amqp-0.6.4 examples/mq/primes-simple.rb
tmm1-amqp-0.5.1 examples/primes-simple.rb
tmm1-amqp-0.5.2 examples/primes-simple.rb
tmm1-amqp-0.5.3 examples/mq/primes-simple.rb
tmm1-amqp-0.5.5 examples/mq/primes-simple.rb
tmm1-amqp-0.5.9 examples/mq/primes-simple.rb
tmm1-amqp-0.6.0 examples/mq/primes-simple.rb
tmm1-amqp-0.6.1 examples/mq/primes-simple.rb
tmm1-amqp-0.6.3 examples/mq/primes-simple.rb
tmm1-amqp-0.6.4 examples/mq/primes-simple.rb
amqp-0.7.0.pre examples/mq/primes-simple.rb
totty-amqp-0.6.7.1 examples/mq/primes-simple.rb
totty-amqp-0.6.7.1.totty examples/mq/primes-simple.rb