From d2c53010000ac957ec927c55443fb19c8b92b593 Mon Sep 17 00:00:00 2001 From: Evan Hemsley Date: Tue, 6 Sep 2016 00:10:17 -0700 Subject: [PATCH] cleanup --- ruby/euler051.rb | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/ruby/euler051.rb b/ruby/euler051.rb index 807abed..15cd36a 100644 --- a/ruby/euler051.rb +++ b/ruby/euler051.rb @@ -1,31 +1,5 @@ require_relative 'euler' -# i = 0 -# Prime.take_while do |p| -# i += 1 -# result = false -# digits = p.to_digit_list -# Euler.non_empty_subsets(digits).each do |index_list| -# related_primes = [] -# ('1'..'9').each do |j| -# copied_digit_list = Array.new(digits) -# index_list.each do |index| -# copied_digit_list[index] = j -# end -# new_num = Euler.from_digit_list(copied_digit_list) -# related_primes.push(new_num) if new_num.prime? and !related_primes.include?(new_num) -# end -# if related_primes.count == 7 -# puts p -# puts '---' -# puts related_primes.inspect -# result = related_primes -# end -# end -# puts result if i % 1000 -# result == false -# end - def bitmasks(length) (1..2**length-1).map { |n| n.to_s(2) }.map { |s| s.rjust(4, '0')}.map { |s| s.split('').map(&:to_i)} end