Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GameOfLife
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
Model registry
Operate
Environments
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
clemo
GameOfLife
Commits
249d4bf5
Commit
249d4bf5
authored
4 years ago
by
clemo
Browse files
Options
Downloads
Patches
Plain Diff
remove gol_setCell
Signed-off-by:
clemo
<
clemo@cbcode.at
>
parent
6d555dc0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/gol.c
+2
-9
2 additions, 9 deletions
src/gol.c
src/gol.h
+0
-1
0 additions, 1 deletion
src/gol.h
with
2 additions
and
10 deletions
src/gol.c
+
2
−
9
View file @
249d4bf5
...
...
@@ -41,13 +41,6 @@ int pMod(int x, int y)
return
(
x
+
y
)
%
y
;
}
void
gol_setCell
(
gol_t
*
g
,
int
cell
)
{
cell
=
pMod
(
cell
,
g
->
width
*
g
->
height
);
div_t
d
=
div
(
cell
,
8
);
g
->
next
[
d
.
quot
]
|=
(
1
<<
(
7
-
d
.
rem
));
}
int
getCell
(
gol_t
*
g
,
int
cell
)
{
cell
=
pMod
(
cell
,
g
->
width
*
g
->
height
);
...
...
@@ -135,7 +128,7 @@ void gol_tick(gol_t *g)
//living cell
if
(
1
<
sn
&&
sn
<
4
)
{
g
->
next
[
d
.
quot
]
|=
(
1
<<
(
d
.
rem
)
)
;
g
->
next
[
d
.
quot
]
|=
(
1
<<
d
.
rem
);
}
}
else
...
...
@@ -143,7 +136,7 @@ void gol_tick(gol_t *g)
//dead cell
if
(
sn
==
3
)
{
g
->
next
[
d
.
quot
]
|=
(
1
<<
(
d
.
rem
)
)
;
g
->
next
[
d
.
quot
]
|=
(
1
<<
d
.
rem
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
src/gol.h
+
0
−
1
View file @
249d4bf5
...
...
@@ -16,6 +16,5 @@ typedef void (*gol_print_ln)(unsigned int line);
gol_t
*
gol_setup
(
int
width
,
int
height
);
void
gol_tick
(
gol_t
*
g
);
void
gol_each
(
gol_t
*
g
,
gol_print_colmn
colmn
,
gol_print_ln
ln
);
void
gol_setCell
(
gol_t
*
g
,
int
cell
);
void
gol_free
(
gol_t
*
data
);
#endif
\ No newline at end of file
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