Hi all,
I started playing with the MIPS track. In the “Leap” practice I face a strange error message in the test runner:
failed for test input: 1. expected 0 to be 1818845542
My code looks like this:
.globl is_leap_year
is_leap_year:
li $v0, 0
li $s0, 400
div $a0, $s0
mfhi $t0
slti $v0, $t0, 1
beq $v0, 1, end
li $v0, 0
li $s0, 100
div $a0, $s0
mfhi $t0
beq $t0, 0, divby100
li $v0, 0
li $s0, 4
div $a0, $s0
mfhi $t0
slti $v0, $t0, 1
beq $v0, 1, end
divby100:
li $v0, 0
end:
jr $ra
Is my code messing up the test code?
I tried checking the test code, but did not find a spot where the “1” as input comes in.
Any advice?
thx
flory