duel engine written in python