Skip to content

Commit 8302312

Browse files
committed
Update
Var to Let Ass class diagram
1 parent 7a40758 commit 8302312

File tree

4 files changed

+173
-54
lines changed

4 files changed

+173
-54
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,4 +1543,39 @@ Modification de la prise en compte de la touche Espace
15431543
Vitesse du serpent, enregistrement des scores...
15441544

15451545
Modification des mots clés var en let ou const
1546-
Fonctions fléchées...
1546+
Fonctions fléchées...
1547+
1548+
# Diagrammes
1549+
1550+
## Diagramme de classe
1551+
1552+
```plantuml
1553+
@startuml
1554+
'https://plantuml.com/class-diagram
1555+
1556+
1557+
class Snake {
1558+
Array body
1559+
string direction
1560+
boolean ateApple false
1561+
1562+
constructor(Array body, string direction): Snake
1563+
draw(): void
1564+
move(): void
1565+
setDirection(string newDirection): void
1566+
checkCollision(): boolean
1567+
isEatingApple(apple): boolean
1568+
}
1569+
1570+
class Apple {
1571+
Array position
1572+
1573+
constructor(Array position): Apple
1574+
draw(): void
1575+
setNewPosition(): void
1576+
isOnSnake( Snake ): boolean
1577+
isEatingApple(apple): boolean
1578+
}
1579+
1580+
@enduml
1581+
```

SnakeGame.puml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
@startuml
2+
'https://plantuml.com/class-diagram
3+
4+
5+
class Snake {
6+
Array body
7+
string direction
8+
boolean ateApple false
9+
10+
constructor(Array body, string direction): Snake
11+
draw(): void
12+
move(): void
13+
setDirection(string newDirection): void
14+
checkCollision(): boolean
15+
isEatingApple(apple): boolean
16+
}
17+
18+
class Apple {
19+
Array position
20+
21+
constructor(Array position): Apple
22+
draw(): void
23+
setNewPosition(): void
24+
isOnSnake( Snake ): boolean
25+
isEatingApple(apple): boolean
26+
}
27+
28+
@enduml

0 commit comments

Comments
 (0)