Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lemarcque
lemarcque / exercice-fibonnaci-closure.go
Created January 27, 2021 21:36
Answer of the exercice "WordCount" of gotour https://tour.golang.org/moretypes/26
package main
import "fmt"
// fibonacci is a function that returns
// a function that returns an int.
func fibonacci() func() int {
n1 := 0
n2 := 1
return func() int {
@lemarcque
lemarcque / exercice-maps.go
Last active February 2, 2021 22:28
Answer of the exercice "Maps" of gotour https://tour.golang.org/moretypes/23
package main
import (
"golang.org/x/tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
splitArr := strings.Fields(s);
m := make(map[string]int)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
package;
import flash.display.Shape;
import flash.Lib;
/**
* ...
* @author Lemarcque
* Description : Random artistic Bar color
*/
class BarColor