interplane.Get Omega
Read in your language

omega-rosetta

aien-dev/omega-rosetta

Brought by drakestapleton

branch main Branches Tags History

omega-rosetta / exercises / queen-attack / queen-attack.om

15 lines · 701 bytes Raw Blame History
1note Exercism-style exercise "queen-attack": https://exercism.org/tracks/python/exercises/queen-attack
2note SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3note Rows and columns run 0 .. 7. create checks one queen's position: 0 valid, 1 row negative,
4note 2 row past the board, 3 column negative, 4 column past the board (row checked first).
5note canattack is true when queens at (wr, wc) and (br, bc) share a row, column or diagonal.
6note Check it with: sh exercise.sh exercises/queen-attack
7om2
8fn create row long col long to int
9note replace this line with your solution
10trap 13
11end
12fn canattack wr long wc long br long bc long to bool
13note replace this line with your solution
14trap 13
15end