Skip to content

Instantly share code, notes, and snippets.

View valeriofarias's full-sized avatar

Valério Farias valeriofarias

View GitHub Profile
@valeriofarias
valeriofarias / Readme_spiral.md
Last active January 1, 2016 16:25
Create Spiral with Arrays in Golang

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

@valeriofarias
valeriofarias / fizzbuzz.go
Last active July 7, 2018 03:24
FizzBuzz with Unit Test written using GoLang
package fizzbuzz
import "strconv"
func Fizzbuzz(n int) string {
var name string = ""
if n%3 == 0 {
name = "Fizz"
@valeriofarias
valeriofarias / fizzbuzz.go
Created December 27, 2015 20:42
FizzBuzz written using Golang
// 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"
@valeriofarias
valeriofarias / game_of_life.rb
Created July 1, 2010 22:20
My solution for RPCFN #11: The Game of Life
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