This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case Y>Ymin && vSpeed>vSpeedmin && abs(hSpeed)<hSpeedmin && X>(landhere+breakdist): | |
vitesse = 4 | |
angle = anglego | |
case Y>Ymin && X<((landhere.Y+landhere.X)/2-breakdist) && hSpeed==0: | |
Strategie = "go" | |
case Y>Ymin && X<((landhere.Y+landhere.X)/2-breakdist) && hSpeed>0 && vSpeed > vSpeedmin: | |
Strategie = "go" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
//import "os" | |
type XY struct { | |
X int | |
Y int | |
} | |
func main() { | |
var surfaceN int | |
fmt.Scan(&surfaceN) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
package main | |
import "fmt" | |
func main() { | |
var total int | |
var n int = 1000/3 | |
for i:=1; i<n+1 ; i++ { | |
total+=i*3 | |
} | |
n=(1000-1)/5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
//import "math" | |
//import "os" | |
type AB struct { | |
A int | |
B int | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "strings" | |
import "strconv" | |
Atoi (string=>int) | |
if s, err := strconv.Atoi(v); err == nil {} | |
Itoa (int=>string) | |
s := strconv.Itoa(i) | |
Contains ? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func whereismymin(Slice []float64) int { | |
var N int = len(Slice) | |
var min float64 = Slice[0] | |
var posmin int | |
for i:=1 ; i<N ; i++ { | |
if Slice[i]<min { | |
min = Slice[i] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Déclaration de valeur | |
var N int = 1 | |
var i, j int = 1, 2 | |
var Slice []int = [1] | |
//Conversion | |
var a float64 = float64(b) | |
a:= float64(b) | |
var a uint = uint(f) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//VALEUR ABSOLUE SUR ENTIER | |
func abs(n int) int { | |
if n < 0 { | |
return -n | |
} | |
return n | |
} |