Skip to content

Instantly share code, notes, and snippets.

Avatar

Christian Siegert ChristianSiegert

View GitHub Profile
@ChristianSiegert
ChristianSiegert / challenge-2012-10-12.go
Created Oct 13, 2012
Solution written in Go for challenge 2012-10-12 on ProgrammingPraxis.com
View challenge-2012-10-12.go
// The MIT License (MIT)
// Copyright (c) 2012 Christian Siegert
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@ChristianSiegert
ChristianSiegert / challenge-2012-03-23.go
Created Jun 17, 2012
Solution written in Go for challenge 2012-03-23 on ProgrammingPraxis.com
View challenge-2012-03-23.go
// Exercise from: http://programmingpraxis.com/2012/03/23/base-26-arithmetic/
// Exercise: Write a function that takes two base-26 numbers in which digits are represented by letters with A=0, B=1, … Z=25 and returns their product using the same notation. As an example, CSGHJ × CBA = FNEUZJA.
package main
import (
"fmt"
"math"
)
@ChristianSiegert
ChristianSiegert / challenge-2012-03-16.go
Created Jun 16, 2012
Solution written in Go for challenge 2012-03-16 on ProgrammingPraxis.com
View challenge-2012-03-16.go
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println("Exercise from: http://programmingpraxis.com/2012/03/16/sum-of-squares-of-two-largest-of-three-values/")
fmt.Println("Exercise: Define a procedure that takes three numbers as arguments and returns the sum of the squares of the two larger numbers.")
@ChristianSiegert
ChristianSiegert / challenge-2012-05-25.go
Created Jun 16, 2012
Solution written in Go for challenge 2012-05-25 on ProgrammingPraxis.com
View challenge-2012-05-25.go
package main
import (
"fmt"
)
func main() {
fmt.Println("Challenge from: http://programmingpraxis.com/2012/05/25/ackermanns-function/")
fmt.Println("Challenge: Your task is to implement Ackermann’s function.")
fmt.Println("A(3, 4):", A(3, 4))
@ChristianSiegert
ChristianSiegert / challenge-2012-06-15-a.go
Created Jun 16, 2012
Solutions written in Go for challenge 2012-06-15 on ProgrammingPraxis.com
View challenge-2012-06-15-a.go
package main
import (
"fmt"
"strconv"
)
func main() {
fmt.Println("Question from: http://programmingpraxis.com/2012/06/15/counting-ones/")
fmt.Println("Question: Consider a function f that takes a positive integer n and returns the number of 1s in the decimal representation of all the integers from 0 to n, inclusive. For example, f(13) = 6, for the numbers 1, 10, 11 (twice, for two 1s), 12 and 13. Notice that f(1) = 1. After 1, what is the next largest n for which f(n) = n?")