Skip to content
Snippets Groups Projects
Commit 53975c10 authored by Snorre Åldstedt's avatar Snorre Åldstedt
Browse files

Add example GUI, not finished! Fixed stigespill.py and add snakes and ladders

parent ae9a7818
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="e57221de-e249-401c-a343-3c2b75ee2a84" name="Default Changelist" comment="Add example GUI, not finished!">
<change afterPath="$PROJECT_DIR$/full_gui.py" afterDir="false" />
<list default="true" id="e57221de-e249-401c-a343-3c2b75ee2a84" name="Default Changelist" comment="Add example GUI, not finished! Fixed stigespill.py and add snakes and ladders">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/components.py" beforeDir="false" afterPath="$PROJECT_DIR$/components.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/gui.py" beforeDir="false" afterPath="$PROJECT_DIR$/gui.py" afterDir="false" />
......@@ -155,7 +154,7 @@
<workItem from="1635254429460" duration="2091000" />
<workItem from="1635339722107" duration="4129000" />
<workItem from="1635413216322" duration="1542000" />
<workItem from="1636465181653" duration="2704000" />
<workItem from="1636465181653" duration="4509000" />
</task>
<task id="LOCAL−00001" summary="Add new test">
<created>1633441910026</created>
......@@ -175,7 +174,13 @@
<option name="presentableId" value="LOCAL−00003" />
<updated>1635162721550</updated>
</task>
<option name="localTasksCounter" value="4" />
<task id="LOCAL−00004" summary="Add example GUI, not finished! Fixed stigespill.py and add snakes and ladders">
<created>1636468092165</created>
<option name="number" value="LOCAL−00004" />
<option name="presentableId" value="LOCAL−00004" />
<updated>1636468092165</updated>
</task>
<option name="localTasksCounter" value="5" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
......@@ -197,12 +202,13 @@
<MESSAGE value="Add new test" />
<MESSAGE value="Add GUI-file" />
<MESSAGE value="Add example GUI, not finished!" />
<option name="LAST_COMMIT_MESSAGE" value="Add example GUI, not finished!" />
<MESSAGE value="Add example GUI, not finished! Fixed stigespill.py and add snakes and ladders" />
<option name="LAST_COMMIT_MESSAGE" value="Add example GUI, not finished! Fixed stigespill.py and add snakes and ladders" />
</component>
<component name="com.intellij.coverage.CoverageDataManagerImpl">
<SUITE FILE_PATH="coverage/stigespill$stigespill.coverage" NAME="stigespill Coverage Results" MODIFIED="1636467873617" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/stigespill$gui.coverage" NAME="gui Coverage Results" MODIFIED="1636465778667" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/stigespill$stigespill.coverage" NAME="stigespill Coverage Results" MODIFIED="1636469003018" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/stigespill$gui.coverage" NAME="gui Coverage Results" MODIFIED="1636468888094" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/stigespill$index.coverage" NAME="index Coverage Results" MODIFIED="1635256449852" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/../../snake-and-ladder-game-using-pygame/Snake and Ladder Game using Pygame" />
<SUITE FILE_PATH="coverage/stigespill$full_gui.coverage" NAME="full_gui Coverage Results" MODIFIED="1635339758162" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
<SUITE FILE_PATH="coverage/stigespill$full_gui.coverage" NAME="full_gui Coverage Results" MODIFIED="1636468682918" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
</component>
</project>
\ No newline at end of file
......@@ -4,7 +4,7 @@ import random
class Square:
def __init__(self, id_nr):
self.id_nr = id_nr
self.persons =[]
self.persons = []
class Players:
......@@ -35,6 +35,7 @@ class Board:
def __init__(self, squares):
self.squares = {x: Square(x) for x in range(squares)}
class Ladder:
def __init__(self, start, end):
self.start = start
......
......@@ -11,7 +11,11 @@ class Game(tk.Frame):
self.master.title("Stigespill")
self.main_grid = tk.Frame(
self, bg = "black", bd=3, width = 800, height = 600
self,
bg = "black",
bd = 3,
width = 800,
height = 600
)
self.main_grid.grid(pady=(100, 0))
self.make_GUI()
......
......@@ -20,7 +20,6 @@ LADDERS = {
69: 90,
77: 99
}
SNAKES = {
97: 21,
66: 50,
......@@ -80,14 +79,12 @@ class Game:
not_end = False
return not_end
#Game object takes 5 arguments, nr of players, nr of squares, sides on the dice, ladders and snakes
def main():
spill = Game(2, SQUARES, SIDES, LADDERS, SNAKES)
while not spill.finished:
spill.do_round()
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment