Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
graphics_in_c
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
Container registry
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
Sankkara Narayanan
graphics_in_c
Commits
f7ca85ff
Commit
f7ca85ff
authored
7 years ago
by
Sankkara Narayanan
Browse files
Options
Downloads
Patches
Plain Diff
Add fan with pie slice
parent
88661766
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
fan2.c
+52
-0
52 additions, 0 deletions
fan2.c
with
52 additions
and
0 deletions
fan2.c
0 → 100644
+
52
−
0
View file @
f7ca85ff
/**
* rotating fan
*/
#include
<graphics.h>
#include
<stdlib.h>
#include
<stdio.h>
int
kbhit
()
{
struct
timeval
tv
;
fd_set
fds
;
tv
.
tv_sec
=
0
;
tv
.
tv_usec
=
0
;
FD_ZERO
(
&
fds
);
FD_SET
(
STDIN_FILENO
,
&
fds
);
//STDIN_FILENO is 0
select
(
STDIN_FILENO
+
1
,
&
fds
,
NULL
,
NULL
,
&
tv
);
return
FD_ISSET
(
STDIN_FILENO
,
&
fds
);
}
int
main
()
{
/* request autodetection */
int
gdriver
=
DETECT
,
gmode
,
errorcode
;
/* Local Variables */
int
x
,
y
;
int
i
;
initgraph
(
&
gdriver
,
&
gmode
,
""
);
x
=
getmaxx
()
/
2
;
y
=
getmaxy
()
/
2
;
i
=
0
;
while
(
!
kbhit
())
{
pieslice
(
x
,
y
,
i
,
i
+
30
,
100
);
pieslice
(
x
,
y
,
i
+
120
,
i
+
150
,
100
);
pieslice
(
x
,
y
,
i
+
240
,
i
+
270
,
100
);
delay
(
15
);
cleardevice
();
i
++
;
}
/* clean up */
closegraph
();
return
0
;
}
\ 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