How to use the ppb.serve function in ppb

To help you get started, we’ve selected a few ppb examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GamesCrafters / GamesmanClassic / misc / ppb / 10-to-0.py View on Github external
@ppb.stat
def stat(position):
	current_position = int(position)
	return ppb.make_stat(position, REMOTE_CACHE[current_position], CACHE[current_position])

@ppb.next_stats
def next_stats(position):
	next_moves = generate_moves(int(position))
	next_positions = [do_move(int(position), nm) for nm in next_moves]
	return [ppb.make_next_stat(str(next_moves[i]), str(next_positions[i]), REMOTE_CACHE[next_positions[i]], CACHE[next_positions[i]], False) for i in range(len(next_moves))]


solve(STARTING_NUMBER)

# Create an infinite while loop that waits for user input
ppb.serve()

ppb

An Event Driven Python Game Engine

Artistic-2.0
Latest version published 9 months ago

Package Health Score

72 / 100
Full package analysis