Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement CxNN Test #27

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions src/tests/3-corax+.8o
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,72 @@

sprite x2 y 4

#################
# Test CxNN (Fairly long test, and also prone to failing)

# See if a random number is returned
y += 5
drawop imC imX

i := image-no

v6 := 0
v7 := 0

loop
v7 += 1
v6 := random 255

if v7 == 0 then jump cxnn-fail
if v6 > 255 then cxnn-fail
if v6 == 0 then
again

# Masking tests
# Mask of 0x00
v6 := 0
v7 := 0

loop
v7 += 1
v6 := random 0

if v6 != 0 then jump cxnn-fail
if v7 != 0 then
again

# Mask of 0x0F
v6 := 0
v7 := 0

loop
v7 += 1
v6 := random 0xF

if v6 > 0xF then jump cxnn-fail
if v7 != 0 then
again

# Mask of 0xF0
v6 := 0
v7 := 0
v4 := 0xF0

loop
v7 += 1
v6 := random 0xF0
v5 := v6
v5 &= v4

if v6 > 0xF0 then jump cxnn-fail
if v6 != v5 then jump cxnn-fail
if v7 != 0 then
again

i := image-ok
: cxnn-fail
sprite x2 y 4

#################
# Test is done!

Expand Down