Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
10
Task/Show-ASCII-table/Ruby/show-ascii-table.rb
Normal file
10
Task/Show-ASCII-table/Ruby/show-ascii-table.rb
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
chars = (32..127).map do |ord|
|
||||
k = case ord
|
||||
when 32 then "␠"
|
||||
when 127 then "␡"
|
||||
else ord.chr
|
||||
end
|
||||
"#{ord.to_s.ljust(3)}: #{k}"
|
||||
end
|
||||
|
||||
chars.each_slice(chars.size/6).to_a.transpose.each{|s| puts s.join(" ")}
|
||||
Loading…
Add table
Add a link
Reference in a new issue