Skip to content

Commit bcd688c

Browse files
rebase
1 parent e5cb26a commit bcd688c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

exercises/practice/darts/.meta/example.asm

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ score:
1616
mulsd xmm1, xmm1 ; y^2
1717
addsd xmm0, xmm1 ; x^2 + y^2
1818
sqrtsd xmm0, xmm0 ; square root of x^2 + y^2, or distance to the center
19-
19+
2020
xor rax, rax ; base value is 0
2121

2222
movsd xmm1, qword [outer_radius]
23-
ucomisd xmm0, xmm1
23+
ucomisd xmm0, xmm1
2424
ja outside_target ; if distance is greater than outer circle, missed the target
25-
25+
2626
movsd xmm1, qword [mid_radius]
2727
ucomisd xmm0, xmm1
2828
ja inside_outer_circle ; if distance is greater than mid circle, it's between mid and outer
@@ -31,7 +31,7 @@ score:
3131
ucomisd xmm0, xmm1
3232
ja inside_middle_circle ; if distance is greater than inner circle, it's between inner and mid
3333
; otherwise, it's inside inner circle
34-
34+
3535
; instructions fall through, accumulating values to give the total for each case
3636
add al, 5
3737
inside_middle_circle:
@@ -44,4 +44,3 @@ outside_target:
4444
%ifidn __OUTPUT_FORMAT__,elf64
4545
section .note.GNU-stack noalloc noexec nowrite progbits
4646
%endif
47-

exercises/practice/darts/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
AS = nasm
22

3-
CFLAGS = -g -Wall -Wextra -pedantic -Werror
3+
CFLAGS = -g -Wall -Wextra -pedantic -Werror -std=c2x -Wno-gnu-binary-literal
44
LDFLAGS =
55
ASFLAGS = -g -F dwarf -Werror
66

generators/exercises/darts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
extern uint8_t score(double x, double y);
55
"""
66

7+
78
def gen_func_body(prop, inp, expected):
89
str_list = []
910
x = inp["x"]

0 commit comments

Comments
 (0)