Search found 7 matches
- Wed Feb 01, 2012 9:57 pm
- Forum: Challenges Solved
- Topic: Ave
- Replies: 17
- Views: 1781
- Mon Jan 23, 2012 11:52 pm
- Forum: Challenges Solved
- Topic: 3280
- Replies: 20
- Views: 1779
My solution in ruby:
Code: Select all
file = File.new("rfc3280.txt", "r")
dict = Hash.new(0)
while (line = file.gets)
line.scan(/[^\w]([\w]{9})[^\w]/) { |match|
dict.store(match, dict[match].succ)
}
end
puts dict.index(dict.values.max)
file.close
- Sun Jan 08, 2012 5:42 pm
- Forum: Challenges Solved
- Topic: NEWSGROUP Cipher
- Replies: 9
- Views: 1531
- Thu Jan 05, 2012 12:49 am
- Forum: Challenges Solved
- Topic: didactic green
- Replies: 12
- Views: 1213
Four lines in Ruby:
Code: Select all
image = ChunkyPNG::Image.from_file('greenline.png')
for i in 0..image.width-1
print ChunkyPNG::Color.g(image[i,0]).chr
end
- Thu Jan 05, 2012 12:30 am
- Forum: Challenges Solved
- Topic: Didactic RGB
- Replies: 17
- Views: 1610
My tiny ruby solution:
Code: Select all
require 'rubygems'
require 'chunky_png'
image = ChunkyPNG::Image.from_file('didactrgb.png')
color = ChunkyPNG::Color.to_truecolor_bytes(image[0,0])
color.map! { |x| x.to_s(2).rjust(8, '0') }
puts color.join.to_i(2)
- Wed Jan 04, 2012 3:33 pm
- Forum: Challenges Solved
- Topic: A Few Percent
- Replies: 8
- Views: 872
My tiny ruby solution:
Code: Select all
input = "%66%75%67%6C%79"
extension = input.scan(/[0-9A-Z]{2,2}/)
extension.map! { |x| x.hex.chr }
output = extension.join
puts output
- Wed Jan 04, 2012 2:15 pm
- Forum: Challenges Solved
- Topic: Didactic XOR
- Replies: 7
- Views: 1179
My solution in ruby:
Code: Select all
input = ["9f", "c7"]
input.map! {
|x| x.to_i(16)
}
output = input.first ^ input.last
puts output.chr