Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Snake-E24
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Oussama Addi
Snake-E24
Commits
7e43826e
Commit
7e43826e
authored
8 months ago
by
Leo
Browse files
Options
Downloads
Patches
Plain Diff
update afficher_plateau
parent
4b93dd2b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
afficher_plateau.sh
+4
-4
4 additions, 4 deletions
afficher_plateau.sh
with
4 additions
and
4 deletions
afficher_plateau.sh
+
4
−
4
View file @
7e43826e
#!/usr/bin/env bash
# $1 est une liste des coo de pomme, $2 est une liste du corps du snake, $3 est un entier de la longueur du plateau
function
afficher_plateau
{
for
i
in
{
0..
"
$
3
"
}
for
i
in
{
0..
"
$
plateau_longueur
"
}
do
for
y
in
{
0..
"
$3
"
}
do
if
[
"
$i
"
-eq
0
]
||
[
"
$y
"
-eq
0
]
||
[
"
$i
"
-eq
getP
lateau
L
ongueur
]
||
[
"
$y
"
-eq
getP
lateau
Larg
eur
]
if
[
"
$i
"
-eq
0
]
||
[
"
$y
"
-eq
0
]
||
[
"
$i
"
-eq
"
$p
lateau
_l
ongueur
"
]
||
[
"
$y
"
-eq
"
$p
lateau
_longu
eur
"
]
then
echo
-n
" ⬛"
;
elif
test
"
$i
"
-eq
"
${
1
[0]
}
"
&&
test
"
$y
"
-eq
"
${
1
[1]
}
"
elif
test
"
$i
"
-eq
"
${
pomme
[0]
}
"
&&
test
"
$y
"
-eq
"
${
pomme
[1]
}
"
then
echo
-n
" 🟥"
;
else
body_part
=
0
for
part
in
"
${
2
[@]
}
"
;
do
for
part
in
"
${
snake_body
[@]
}
"
;
do
IFS
=
","
read
part_x part_y
<<<
"
$part
"
if
[[
"
$i
"
-eq
"
$part_x
"
&&
"
$y
"
-eq
"
$part_y
"
]]
;
then
echo
-n
" 🟩"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment