YAPC::EU 2018 Glasgow Update!

This commit is contained in:
Ingy döt Net 2018-08-17 15:15:24 +01:00
parent 22f33d4004
commit 4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions

View file

@ -0,0 +1,8 @@
110p>>55+109"iccanaceD"22099v
v9013"Tetranacci"9014"Lucas"<
>"iccanobirT"2109"iccanobiF"v
>>:#,_0p20p0>:01-\2>#v0>#g<>>
^_@#:,+55$_^ JH v`1:v#\p03<
_$.1+:77+`^vg03:_0g+>\:1+#^
50p-\30v v\<>\30g1-\^$$_:1-
05g04\g< >`#^_:40p30g0>^!:g

View file

@ -1,6 +1,4 @@
/*29th August, 2012
Abhishek Ghosh
/*
The function anynacci determines the n-arity of the sequence from the number of seed elements. 0 ended arrays are used since C does not have a way of determining the length of dynamic and function-passed integer arrays.*/
#include<stdlib.h>

View file

@ -2,37 +2,38 @@ package main
import "fmt"
func g(i []int, c chan int) {
var sum int
b := append([]int{}, i...)
for _, t := range b {
c <- t
sum += t
}
for {
for j, t := range b {
c <- sum
b[j], sum = sum, sum+sum-t
}
}
func g(i []int, c chan<- int) {
var sum int
b := append([]int(nil), i...) // make a copy
for _, t := range b {
c <- t
sum += t
}
for {
for j, t := range b {
c <- sum
b[j], sum = sum, sum+sum-t
}
}
}
func main() {
for _, s := range []struct {
seq string
i []int
} {
{"Fibonacci", []int{1, 1}},
{"Tribonacci", []int{1, 1, 2}},
{"Tetranacci", []int{1, 1, 2, 4}},
{"Lucas", []int{2, 1}},
} {
fmt.Printf("%10s:", s.seq)
c := make(chan int)
go g(s.i, c)
for j := 0; j < 10; j++ {
fmt.Print(" ", <-c)
}
fmt.Println()
}
for _, s := range [...]struct {
seq string
i []int
}{
{"Fibonacci", []int{1, 1}},
{"Tribonacci", []int{1, 1, 2}},
{"Tetranacci", []int{1, 1, 2, 4}},
{"Lucas", []int{2, 1}},
} {
fmt.Printf("%10s:", s.seq)
c := make(chan int)
// Note/warning: these goroutines are leaked.
go g(s.i, c)
for j := 0; j < 10; j++ {
fmt.Print(" ", <-c)
}
fmt.Println()
}
}

View file

@ -1,7 +1,4 @@
# Project : Fibonacci n-step number sequences
# Date : 2017/10/07
# Author : Gal Zsolt (~ CalmoSoft ~)
# Email : <calmosoft@gmail.com>
f = list(12)