Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Member 7716127

@Member 7716127
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • IQ / Programming Quiz (Cannon-Ball Stacks)
    M Member 7716127

    Answer: [120 ball pyramid] + [560 ball pyramid] = [680 ball pyramid]
    def tetrahedral_number(n) return n*(n+1)*(n+2)/6 end #Build an array of tetrahedral numbers t_nums = [] for i in (1..100) t_nums << tetrahedral_number(i) end print "Tetrahedral Cannonball Stack Combinations:\n\n" str = "ball pyramid" #Find sums of tetrahedral numbers that are in the tetrahedral number set for i in (0..99) for j in (i..99) if t_nums.include?(t_nums[i] + t_nums[j]) total = t_nums[i] + t_nums[j] print "[#{t_nums[i]} #{str}] + ", "[#{t_nums[j]} #{str}] = ", "[#{total} #{str}] \n\n" end end end

    The Lounge help com question learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups