Task taked from codewars.com: Make a spiral using Golang
Our task, is to create a NxN spiral with a given size.
For example, spiral with size 5 should look like this:
00000 ....0 000.0 0...0
require 'rubygems' | |
class GameOfLife | |
attr_accessor :state, :tmp_state | |
def initialize(size) | |
@size = size | |
@state = Array.new(@size){ Array.new @size } | |
@size.times{ |row| @size.times{ |column| @state[row][column] = rand(2) } } | |
@tmp_state = @state.clone |
// FizzBuzz | |
// A program that prints the numbers from 1 to n. But for multiples of three | |
// print “Fizz” instead of the number and for the multiples of five print “Buzz”. | |
// For numbers which are multiples of both three and five print “FizzBuzz”. | |
package main | |
import ( | |
"fmt" | |
"strconv" |
Task taked from codewars.com: Make a spiral using Golang
Our task, is to create a NxN spiral with a given size.
For example, spiral with size 5 should look like this:
00000 ....0 000.0 0...0
package fizzbuzz | |
import "strconv" | |
func Fizzbuzz(n int) string { | |
var name string = "" | |
if n%3 == 0 { | |
name = "Fizz" |