-
-
Save meriy100/f55eca50ea87d7cbbea60e1afba23496 to your computer and use it in GitHub Desktop.
ruby FizzBuzz.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tempfile' | |
Tempfile.create('fizzbuzz-') do |tmp| | |
str = "99 108 97 115 115 32 65 114 114 97 121 10 32 | |
32 100 101 102 32 128150 10 32 32 32 32 | |
40 102 105 114 115 116 | |
46 111 114 100 32 | |
47 32 108 97 | |
115 116 46 111 | |
114 100 41 46 | |
99 104 114 10 32 32 101 | |
110 100 10 10 32 32 97 108 105 | |
97 115 32 128147 32 109 97 112 10 | |
32 32 97 108 105 | |
97 115 32 128148 32 106 111 105 | |
110 10 101 110 100 10" | |
File.write(tmp.path,str.split(' ').map{|i|i. to_i.chr("UTF-8") }.join) | |
load tmp.path | |
1.upto(gets.to_i) do |n| | |
puts([['π', "ά¦"], ['π', 'Σ'], ['π·', 'Π'], ['π·', 'Π'], ['π', "ή" ], ['π', 'Ρ'], ['π·', 'Π'], ['π·', 'Π'], [ 'π»', 'γ²']] | |
.π(&:π) | |
.π[ i = n ** 4 % -15, i + 13] || n) | |
end | |
end |
Author
meriy100
commented
Apr 16, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment