Skip to content

Instantly share code, notes, and snippets.

@vznvzn
Created November 16, 2018 05:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vznvzn/d1c9ac0d41b58c61efde30bd5ac4cf62 to your computer and use it in GitHub Desktop.
Save vznvzn/d1c9ac0d41b58c61efde30bd5ac4cf62 to your computer and use it in GitHub Desktop.
c = ARGV[0].to_i
n = 0
e = (c - 1) * 2
(c - 1).times \
{
puts("#{n} #{n + 1} 1")
puts("#{n} #{e} 0") if (!ARGV[1].nil?)
puts("#{n + 1} #{n + 2} 1")
puts("#{n + 1} #{n + 2} 2")
n += 2
}
puts("#{e} #{e + 1} 1")
puts("#{e + 1} #{e + 2} 2")
n += 2
puts("#{e + 2} #{e + 3} 2")
puts(e + 3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment