mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-25 18:58:56 -06:00
the NQueens algorithm written in GF
This commit is contained in:
11
examples/nqueens/NQueensAscii.gf
Normal file
11
examples/nqueens/NQueensAscii.gf
Normal file
@@ -0,0 +1,11 @@
|
||||
concrete NQueensAscii of NQueens = NatAscii ** {
|
||||
|
||||
lincat Matrix, Vec = Str ;
|
||||
Constr, Sat = {} ;
|
||||
|
||||
lin nilV _ _ = "" ;
|
||||
consV _ _ f _ l _ v = f ++ "X" ++ l ++ "\n" ++ v ;
|
||||
|
||||
matrix _ v = v ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user