I am working on the PSET6 more. My code passes the check50, and it displays the comparing table in the website. However, nothing is showing up for the log operations. I have around for answers but I still could not fix mine.

(Not sure if I could show all the distances function) I used a list "cost" initiated with all (0,0) and run codes like

cost[i][j] = (cost[i][j-1][0]+1, Operation.INSERTED)

to update the cost and operations.

And here is a screenshot of what my table looks like: enter image description here

Thanks for any help!


You're probably providing the right numbers, but each cell of the matrix should consist of the cost and the action that led to that number (whether you got there from the cell to the left, above, or above left). check50 does not test for the path, as there can be multiple paths of same cost, the test would be more complex.

You have to use the values defined in the enum, as described in https://docs.cs50.net/2018/x/psets/6/similarities/more/similarities.html#code-helpers-py-code

This file also defines an "enumeration" (i.e., Enum) that essentially defines three constants, each of which represents an operation via which a string might be transformed into another: Operation.DELETED, Operation.INSERTED, and Operation.SUBSTITUTED.

Only the upper left cell (matrix[0][0]) should have an operation of None, this ends the path.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .