/* COLLIER2.LOGIC */ /* Coal-trader for trading game. */ act( collier2, buy, coal, 20 ) :- at_seller( collier2, coal, Price ), carries( collier2, coal, 0 ). act( collier2, sell, coal, 20 ) :- at_buyer( collier2, coal, Price ), carries( collier2, coal, 20 ). act( collier2, buy, fuel, 20 ) :- at_fuel_station( collier2, Price ), fuel( collier2, F ), F < 10. act( collier2, move, M, dummy ) :- at( collier2, N ), clockwise( N, M ). at_seller( T, Good, Price ) :- at( T, Square ), square_sells( Square, Good, Price ). at_buyer( T, Good, Price ) :- at( T, Square ), square_buys( Square, Good, Price ). at_fuel_station( T, Price ) :- at( T, Square ), square_sells_fuel( Square, Price ). square_sells( Square, Good, Price ) :- building( Square, Shop ), sells( Shop, Good, Price ). square_buys( Square, Good, Price ) :- building( Square, Shop ), buys( Shop, Good, Price ). square_sells_fuel( Square, Price ) :- building( Square, Shop ), sells_fuel( Shop, Price ).