Skip to content

Commit 147233c

Browse files
author
oxe-i
committed
associate space age practice exercise with floats and arrays, adjust prerequisite for high-scores
1 parent a2073cc commit 147233c

3 files changed

Lines changed: 18 additions & 3 deletions

File tree

config.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@
293293
"uuid": "c6377959-f8fb-4df4-97c0-f48915076144",
294294
"practices": [],
295295
"prerequisites": [
296-
"interfacing-with-c-types"
296+
"arrays",
297+
"floating-point-numbers"
297298
],
298299
"difficulty": 1,
299300
"topics": [
@@ -379,7 +380,7 @@
379380
"uuid": "808128e8-d23c-40d6-a642-dd3eec3c13cc",
380381
"practices": [],
381382
"prerequisites": [
382-
"arrays"
383+
"loops"
383384
],
384385
"difficulty": 2
385386
},

exercises/practice/space-age/space_age.asm

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@ section .text
22
global age
33
age:
44
; Provide your implementation here
5+
; The function has type signature float age(enum planet planet, int seconds)
6+
; The return value is of type float, which is a 32-bit floating-point number
7+
; The first argument is of type enum planet, which is a 32-bit signed integer that represents a planet:
8+
; 0 -> Mercury
9+
; 1 -> Venus
10+
; 2 -> Earth
11+
; 3 -> Mars
12+
; 4 -> Jupiter
13+
; 5 -> Saturn
14+
; 6 -> Uranus
15+
; 7 -> Neptune
16+
; The second argument is of type int, which is a 32-bit signed integer
517
ret
618

719
%ifidn __OUTPUT_FORMAT__,elf64

exercises/practice/two-fer/two_fer.asm

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ two_fer:
44
; Provide your implementation here
55
; The function has type signature void two_fer(const char *name, char *buffer)
66
; It has no return value
7-
; The first argument is of type const char*, which is the address of a read-only NUL-terminated sequence of bytes stored in memory
7+
; The first argument is of type const char*, which is the address of a read-only NUL-terminated sequence of bytes stored in memory that represents the name of a person
8+
; If no name is passed, this address has a value of 0
89
; The second argument is of type char*, which is the address of a writable sequence of bytes stored in memory
10+
; The resulting string should be NUL-terminated and stored at the location pointed to by the address provided in the second argument.
911
ret
1012

1113
%ifidn __OUTPUT_FORMAT__,elf64

0 commit comments

Comments
 (0)