Newer
Older
Ruby / puzzle2.rb
@DOMON Yuki DOMON Yuki on 4 Apr 2022 330 bytes 2022-04-04 23:01:53
#!usr/bin/env ruby
# -*- coding: utf-8 -*-

#class Coor
#  def x
#    @x
#  end
#  def y
#    @y
#  end
#end

puz = []
puz_num = 1
i = 0

puz_type = gets.to_i
puz_type. times do
  puz << puz_num
  puz_num += 1
end
puz.shuffle!
puz_row = (puz.length + 1) ** (1/2.0)
while puz.length
  n = puz[i]
  printf("%s",n.to_s)
  i += 1
end