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