From: Daniel Moore Date: 2009-03-28T01:51:14+09:00 Subject: [QUIZ] Diamond-Square (#198) -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- The three rules of Ruby Quiz: 1. Please do not post any solutions or spoiler discussion for this quiz until 48 hours have elapsed from the time this message was sent. 2. Support Ruby Quiz by submitting ideas and responses as often as you can! Visit: 3. Enjoy! Suggestion: A [QUIZ] in the subject of emails about the problem helps everyone on Ruby Talk follow the discussion. Please reply to the original quiz message, if you can. -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- ## Diamond-Square (#198) Guten Tag Rubyists, Following in the same vein as last week's quiz I present to you the [diamond-square algorithm][1]. Instead of one dimensional terrain as last week, the random terrain generated by this algorithm is in two dimensions. Visual displays are again encouraged. The secret to this algorithm is that there are two phases for generating the new random values: from the diagonals (diamond) and from the adjacents (square). This makes the generated terrain smoother and prevents artifacts from generating solely by the adjacents. Once equipped with these terrain generation algorithms, making ruby based Elf/Goblin/Tanks simulations will be a breeze! There is now a suggestion form up on the Ruby Quiz website: http://rubyquiz.strd6.com/suggestions . I'm looking forward to all of your great suggestions! [1]: http://gameprogrammer.com/fractal.html#diamond Have Fun! -- -Daniel http://rubyquiz.strd6.com