-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.go
70 lines (59 loc) · 1.86 KB
/
types.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package ceintures
const (
NbDomains = Matrices + 1 // gomacro:no-enum
NbRanks = Noire + 1 // gomacro:no-enum
)
type Level uint8
const (
Seconde Level = iota // Seconde
Premiere // Première
Terminale // Terminale
PostBac // Post-bac
)
// Domain is a sub topic, like "Calcul littéral",
// "Calcul mental".
//
// For now, we only support one scheme in maths.
type Domain uint8
const (
CalculMentalI Domain = iota // Calcul mental I
CalculMentalII // Calcul mental II
Puissances // Puissances et racines
Fractions // Fractions
Reduction // Réduction
Factorisation // Factorisation
Developpement // Développement
IsolerVariable // Isoler une variable
Equations // Équations
Inequations // Inéquations
Derivation // Dérivation
Matrices // Matrices et systèmes
)
// Rank is the belt color, that is the level
// of progression in one [Domain].
type Rank uint8
const (
StartRank Rank = iota // Départ
Blanche // Blanche
Jaune // Jaune
Orange // Orange
VerteI // Verte clair
VerteII // Verte foncée
Bleue // Bleue
Violet // Violette
Rouge // Rouge
Marron // Marron
Noire // Noire
)
type Stat struct {
Success uint16 // number of questions answered with success
Failure uint16 // number of questions answered with failure
}
func (s *Stat) Add(other Stat) {
s.Success += other.Success
s.Failure += other.Failure
}
// Advance stores, for each [Domain], the rank
// the student has checked.
type Advance [NbDomains]Rank
type Stats [NbDomains][NbRanks]Stat // by domain and rank