Question: I want to fix in python!! CSC131 sample game board where n is 6 Homework Assignment # 2 Due: Beginning of class on Wednesday, February
CSC131 sample game board where n is 6 Homework Assignment # 2 Due: Beginning of class on Wednesday, February 14h, 2018. 3506 57 10 of the game is to move from the first column to the last column in the lowest total cost. The number in each column represents the cost to enter that column. You always start the game ian In the board shown above, there are several ways to get to the end. Starting in the first columm, our cost so far is o 147. However, a cheaper path would be to move to 3, jump to 6, then jump to 10, for a total cost of 3+6+10- 19 the first column and have two types of moves. You can either move to the adjacent column or jump over the adjacent column to land two columns over. The cost of a game is the sum af the visitod columns Your program must read input from a text file named input.tst and must send output to stdout (the board. The n long time to rum on large boards, you can assume that a bouard size is at most SO colums, Your program doesnt have to output the actual solution to this problem that computes the cheapest cost of the game and outputs this vaiut t atsequence-of moves, only the chespest cost of We could jump to 80, them jump to 57, then move to 10 for a total of 80+57-10 on a line are the costs to enter the columns on the board. 0 3 80 657 10 n arbitrary large game For example, the above board is represented in the input file as uence of moves, only the cheapest cost of this sequence computer's screen). The input file consists of a sequence of lines, where each line comesponds to a 03 80 6 0 98 7 44 25 3 5 85 46 4 57 10 5759 83 94270 2049 % 5374377 24 17 15 61 49 61 8 65 43 26 99 757 97 50 93 6 82 52 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
