From a5600c2c0590ed4bd334afab3d5ead7b11c7e155 Mon Sep 17 00:00:00 2001 From: Apex Aeon Date: Mon, 16 Apr 2018 14:43:11 -0500 Subject: [PATCH 1/3] Create time.py Time travel implemented --- source/time.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 source/time.py diff --git a/source/time.py b/source/time.py new file mode 100644 index 0000000..1816f45 --- /dev/null +++ b/source/time.py @@ -0,0 +1,2 @@ +def get() +def log() From c130234878acec5e2d79f45400b9b3e8ecd1ea62 Mon Sep 17 00:00:00 2001 From: Apex Aeon Date: Tue, 24 Apr 2018 14:43:05 -0500 Subject: [PATCH 2/3] boi boi --- source/time.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/source/time.py b/source/time.py index 1816f45..93e1fb9 100644 --- a/source/time.py +++ b/source/time.py @@ -1,2 +1,21 @@ -def get() -def log() +continuum = {} +indicies = [] +def retrieve(index): + while True: + +def capture(state, index): + if len(indicies) is 0: # If this is the first capture, place the entire state into the continuum. + continuum[index] = state + else: # If this is not the first capture, place the difference between the previous state and the new state into the continuum. + past = {} + for change in indicies: # Compile all the past state changes leading up to but excluding the present state. + past.update(continuum[change]) + for key in past: # Compare the past and the present. + if state[key] != past[key]: # If they differ + continuum[index].update({key:state[key]}) # Update the continuum + indicies.append(index) # Add the time index to the indicies list. + + + + + From 1e5f3686e2f5522cc7ee090ef82fa7b7cb26c90b Mon Sep 17 00:00:00 2001 From: Apex Aeon Date: Mon, 30 Apr 2018 14:28:39 -0500 Subject: [PATCH 3/3] tried to make it work --- source/time.py | 40 ++++++++++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 6 deletions(-) diff --git a/source/time.py b/source/time.py index 93e1fb9..accbfec 100644 --- a/source/time.py +++ b/source/time.py @@ -1,8 +1,9 @@ continuum = {} indicies = [] +gamestate = {} def retrieve(index): while True: - + pass def capture(state, index): if len(indicies) is 0: # If this is the first capture, place the entire state into the continuum. continuum[index] = state @@ -14,8 +15,35 @@ def capture(state, index): if state[key] != past[key]: # If they differ continuum[index].update({key:state[key]}) # Update the continuum indicies.append(index) # Add the time index to the indicies list. - - - - - +while True: + gamestate = { + "apples":"3", + "action":"none", + "thoughts":"im hungry", + "hunger":"100" + } + capture(gamestate, 0) + gamestate = { + "apples":"2", + "action":"eating", + "thoughts":"yum", + "hunger":"50" + } + capture(gamestate, 1) + gamestate = { + "apples":"1", + "action":"eating", + "thoughts":"i like apples", + "hunger":"25" + } + capture(gamestate, 2) + gamestate = { + "apples":"0", + "action":"none", + "thoughts":"feelin good", + "hunger":"0" + } + capture(gamestate, 4) + print(indicies) + print(continuum) + input()