Skip to content

Commit

Permalink
rename variables
Browse files Browse the repository at this point in the history
  • Loading branch information
LiamSwayne committed Nov 21, 2023
1 parent d723151 commit 4765da6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion linear_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# 1000 is used a placeholder throughout the document for unknown values

# solve linear system
def calculcate(floors=1, xLength=1, yLength=1):
def calculate(floors=1, xLength=1, yLength=1):
# floors is the number of floors of the building
# xLength is the length of the building in tiles
# yLength is the width of the building in tiles
Expand Down Expand Up @@ -63,9 +63,11 @@ def calculcate(floors=1, xLength=1, yLength=1):
floors = int(sys.argv[1])
xLength = int(sys.argv[2])
yLength = int(sys.argv[3])
calculate(floors, xLength, yLength)
else:
print("Invalid command-line arguments. Follow this format: python script.py floors xLength yLength")
randomFloors = random.randint(1, 10)
randomXLength = random.randint(1, 10)
randomYLength = random.randint(1, 10)
print("Running randomized values: floors=" + str(randomFloors) + " xLength=" + str(randomXLength) + " yLength=" + str(randomYLength))
calculate(randomFloors, randomXLength, randomYLength)

0 comments on commit 4765da6

Please sign in to comment.