Cookie Click Simulator
Cookie Click Simulator
import simpleplot
import math
import random
# Constants
SIM_TIME = 10000000000.0
class ClickerState:
"""
Simple class to keep track of the game state.
"""
def __init__(self):
self._total_cookies = 0.0
self._cookies = 0.0
self._time = 0.0
self._cps = 1.0
self._histories = [(0.0, None, 0.0, 0.0)]
def __str__(self):
"""
Return human readable state
"""
def get_cookies(self):
"""
Return current number of cookies
(not total number of cookies)
def get_cps(self):
"""
Get current CPS
def get_time(self):
"""
Get current time
Should return a float
"""
return self._time
def get_history(self):
"""
Return history list
return clicker_state
Note that this simplistic (and broken) strategy does not properly
check whether it can actually buy a Cursor in the time left. Your
simulate_clicker function must be able to deal with such broken
strategies. Further, your strategy functions must correctly check
if you can buy the item in the time left and return None if you
can't.
"""
return "Cursor"
# Uncomment out the lines below to see a plot of total cookies vs. time
# Be sure to allow popups, if you do want to see it
# history = state.get_history()
# history = [(item[0], item[3]) for item in history]
# simpleplot.plot_lines(strategy_name, 1000, 400, 'Time', 'Total Cookies',
[history], True)
def run():
"""
Run the simulator.
"""
#run_strategy("Cursor", SIM_TIME, strategy_cursor_broken)
run()