Skip to content

Instantly share code, notes, and snippets.

View supcik's full-sized avatar

Jacques Supcik supcik

View GitHub Profile
"""
Programme Python pour dessiner un flocon
Portes ouvertes de la Haute école d'ingénierie
et d'architecture de Fribourg
"""
import turtle
t = turtle.Turtle()
t.color("blue")
"""
Programme Python pour faire deviner un nombre
Portes ouvertes de la Haute école d'ingénierie
et d'architecture de Fribourg
"""
import random
maximum = 100
solution = random.randint(1, maximum)
type verbalSum struct {
operands []string
result string
}
@supcik
supcik / recsolver.go
Last active June 3, 2018 17:54
recursive solver
func (v verbalSum) recursiveSolve(
letters []rune, digits []int, mapping map[rune]int,
) (combinations int, solutions int) {
if len(letters) == 0 {
if v.isValidSolution(mapping) {
fmt.Printf("Found %v\n", v.solutionString(mapping))
return 1, 1 // one solution tried, one solution found
}
return 1, 0 // one solution tried, zero solution found
}
class RecursiveChangeMaker():
def __init__(self, total, coins):
self.total = total
self.coins = coins
def solve(self):
def recSolver(total):
if total == 0: return 0
return min([1 + recSolver(total-c) for c in self.coins if c <= total])

Keybase proof

I hereby claim:

  • I am supcik on github.
  • I am supcik (https://keybase.io/supcik) on keybase.
  • I have a public key ASBJKA164Zah_EcKSo_vRfnKoZ51jQIGoaiEN5WHh8zhzQo

To claim this, I am signing this object:

@supcik
supcik / 0_reuse_code.js
Created May 4, 2017 13:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@supcik
supcik / update-telecom-tower-v2.sh
Last active June 15, 2016 12:11
Update telecom tower
# Cleanup source files
cd $HOME
rm -Rf $GOPATH/src/github.com/supcik-go/ws2811
rm -Rf $GOPATH/src/gopkg.in/supcik-go/ws2811.v2
rm -Rf $GOPATH/src/github.com/heia-fr/telecom-tower
rm -Rf $GOPATH/src/github.com/heia-fr/telecom-tower-server
# Cleanup object files
rm -Rf $GOPATH/pkg/*/gopkg.in/supcik-go/ws2811.v2.a
rm -Rf $GOPATH/pkg/*/github.com/supcik-go/ws2811.a