Property definitions

ai $ Tile :: defaultinit
# A movable tile
# A simple class to encapsulate the symbol and the goal position.
class Tile
	super Comparable
	redef type OTHER: Tile is fixed

	# The symbol written on the tile
	var symbol: Char

	# The expected position in the grid
	var goal_idx: Int

	redef fun to_s do return symbol.to_s
	redef fun ==(o) do return o isa Tile and goal_idx == o.goal_idx
	redef fun <(o) do return goal_idx < o.goal_idx
	redef fun <=>(o) do return goal_idx <=> o.goal_idx
end
lib/ai/examples/puzzle.nit:211,1--227,3