Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Redstone
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
zefanxu2
Redstone
Commits
0ea393a8
Commit
0ea393a8
authored
8 years ago
by
xiangli
Browse files
Options
Downloads
Patches
Plain Diff
2333
parent
0c621dc2
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
student-distrib/2048.c
+3
-0
3 additions, 0 deletions
student-distrib/2048.c
student-distrib/systemcall.c
+3
-3
3 additions, 3 deletions
student-distrib/systemcall.c
with
6 additions
and
3 deletions
student-distrib/2048.c
+
3
−
0
View file @
0ea393a8
...
...
@@ -2,6 +2,7 @@
#include
"malloc.h"
#include
"terminal.h"
#include
"keyboard_handler.h"
#include
"systemcall.h"
int
start_2048
()
{
...
...
@@ -9,8 +10,10 @@ int start_2048()
int
rows
,
cols
;
char
buf
[
200
];
clear
();
printf
(
"2048: Enter dimensions (rowscolumns), for example: 4 4
\n
"
);
printf
(
"max 9 rows and 9 columns:
\n
"
);
while
(
1
)
{
terminal_read
(
0
,
buf
,
10
);
if
(
buf
[
0
]
>
48
&&
buf
[
0
]
<
58
&&
buf
[
2
]
>
48
&&
buf
[
2
]
<
58
)
{
...
...
This diff is collapsed.
Click to expand it.
student-distrib/systemcall.c
+
3
−
3
View file @
0ea393a8
...
...
@@ -24,8 +24,8 @@
#define SOUND_PORT_CMD 0x43
#define SOUND_IO_PORT 0x61
int
freq
[
6
4
]
=
{
130
,
1
95
,
261
,
311
,
391
,
311
,
261
,
195
,
130
,
195
,
261
,
311
,
97
,
146
,
195
,
233
,
103
,
155
,
207
,
261
,
311
,
261
,
207
,
155
,
103
,
155
,
261
,
311
,
207
,
349
,
207
,
391
,
195
,
174
,
233
,
293
,
174
,
233
,
293
,
349
,
155
,
233
,
311
,
349
,
97
,
146
,
195
,
233
,
174
,
155
,
207
,
311
,
207
,
155
,
164
,
207
,
155
,
261
,
311
,
466
,
155
,
415
,
207
,
391
};
int
dur
[
6
4
]
=
{
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
40
0
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
400
,
40
0
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
400
,
400
,
400
,
40
0
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
,
2
00
,
2
00
,
4
00
,
4
00
,
4
00
,
4
00
,
4
00
};
int
freq
[
25
6
]
=
{
130
,
1
30
,
130
,
130
,
195
,
195
,
195
,
195
,
261
,
261
,
261
,
261
,
311
,
311
,
311
,
311
,
391
,
391
,
391
,
391
,
311
,
311
,
311
,
311
,
261
,
261
,
261
,
261
,
195
,
195
,
195
,
195
,
130
,
130
,
130
,
130
,
195
,
195
,
195
,
195
,
261
,
261
,
261
,
261
,
311
,
311
,
311
,
311
,
97
,
97
,
97
,
97
,
146
,
146
,
146
,
146
,
195
,
195
,
195
,
195
,
233
,
233
,
233
,
233
,
103
,
103
,
103
,
103
,
155
,
155
,
155
,
155
,
207
,
207
,
207
,
207
,
261
,
261
,
261
,
261
,
311
,
311
,
311
,
311
,
261
,
261
,
261
,
261
,
207
,
207
,
207
,
207
,
155
,
155
,
155
,
155
,
103
,
103
,
103
,
103
,
155
,
155
,
155
,
155
,
261
,
261
,
261
,
261
,
311
,
311
,
311
,
311
,
207
,
207
,
207
,
207
,
349
,
349
,
349
,
349
,
207
,
207
,
207
,
207
,
391
,
391
,
391
,
391
,
349
,
116
,
349
,
116
,
174
,
174
,
174
,
174
,
233
,
233
,
233
,
233
,
293
,
293
,
293
,
293
,
174
,
174
,
174
,
174
,
233
,
233
,
233
,
233
,
293
,
293
,
293
,
293
,
349
,
349
,
349
,
349
,
155
,
155
,
155
,
155
,
233
,
233
,
233
,
233
,
311
,
311
,
311
,
311
,
349
,
349
,
349
,
349
,
97
,
97
,
97
,
97
,
146
,
146
,
146
,
146
,
195
,
195
,
195
,
195
,
233
,
233
,
233
,
233
,
293
,
103
,
293
,
103
,
155
,
155
,
155
,
155
,
207
,
207
,
207
,
207
,
311
,
311
,
311
,
311
,
207
,
207
,
207
,
207
,
155
,
155
,
155
,
155
,
261
,
103
,
261
,
103
,
207
,
207
,
207
,
207
,
155
,
155
,
155
,
155
,
261
,
261
,
261
,
261
,
311
,
311
,
311
,
311
,
466
,
466
,
466
,
466
,
155
,
155
,
155
,
155
,
415
,
415
,
415
,
415
,
207
,
207
,
207
,
207
,
391
,
391
,
391
,
391
};
int
dur
[
25
6
]
=
{
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
50
,
50
,
50
,
50
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
100
,
50
,
50
,
50
,
5
0
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
50
,
50
,
50
,
5
0
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
50
,
50
,
50
,
50
,
50
,
50
,
50
,
5
0
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
,
1
00
};
typedef
int32_t
func
();
...
...
@@ -85,7 +85,7 @@ void song()
{
int
i
;
for
(
i
=
0
;
i
<
6
4
;
i
++
)
for
(
i
=
0
;
i
<
25
6
;
i
++
)
{
sing_song
(
freq
[
i
],
dur
[
i
]);
}
...
...
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