Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Chapter 4/Ex4.2.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def move(self, u): # get next S
elif self.id - 1 == 0:
return 0
elif self.id == 16:
return 16
return 12
else:
return self.id
if u == 'R': # move right
Expand All @@ -26,7 +26,7 @@ def move(self, u): # get next S
elif self.id + 1 == 15:
return 0
elif self.id == 16:
return 16
return 14
else:
return self.id
if u == 'U': # move up
Expand Down Expand Up @@ -92,7 +92,7 @@ def draw(valueArray):
print("| | "+str(int(valueArray[16])) +" | | |")
print("----------------------")
print("Accurate State Values List:")
for i in range(1,8):
for i in range(1,9):
print("State "+str(2*i-1)+": "+str(valueArray[2*i-1])+ " State "+str(2*i)+": "+str(valueArray[2*i]))

if __name__ == '__main__':
Expand Down