Last active
May 9, 2024 17:27
-
-
Save nicknapoli82/2379634e87f24399ed1ed12c4c2e8c9a to your computer and use it in GitHub Desktop.
A test to use for cs50 Tideman problem. Run as "./tideman a b c d e f g h i < Tideman_test.txt"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Here are the pairs, in my codes sorted order, that should be locked or not locked. The end is the winner. | |
This is considering the order of my pairs specifically. If your tied pairs are ordered different, the winner my be different. | |
(winner -> loser) | |
Locked g -> h | |
Locked e -> h | |
Locked e -> f | |
Locked i -> c | |
Locked b -> g | |
Locked b -> h | |
Locked d -> g | |
Locked d -> h | |
Locked f -> h | |
Locked g -> i | |
Did not lock c -> d | |
Locked c -> e | |
Locked c -> f | |
Did not lock c -> g | |
Locked c -> h | |
Locked d -> e | |
Locked d -> f | |
Locked b -> f | |
Locked a -> h | |
Locked e -> a | |
Did not lock e -> b | |
Did not lock a -> d | |
Did not lock e -> g | |
Did not lock a -> c | |
Did not lock e -> i | |
Locked f -> a | |
Did not lock f -> g | |
Locked b -> d | |
Did not lock a -> b | |
Did not lock c -> b | |
Locked i -> a | |
Did not lock i -> b | |
Did not lock a -> g | |
Did not lock i -> d | |
Locked i -> f | |
Locked i -> h | |
Winner = b |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 | |
i | |
b | |
c | |
d | |
e | |
f | |
g | |
h | |
a | |
e | |
f | |
g | |
h | |
i | |
a | |
c | |
b | |
d | |
g | |
h | |
i | |
c | |
a | |
d | |
e | |
b | |
f | |
f | |
e | |
d | |
a | |
b | |
g | |
i | |
h | |
c | |
a | |
d | |
b | |
i | |
c | |
g | |
e | |
f | |
h | |
e | |
f | |
g | |
h | |
i | |
d | |
a | |
c | |
b | |
e | |
c | |
b | |
a | |
d | |
g | |
i | |
h | |
f | |
i | |
f | |
b | |
d | |
a | |
c | |
g | |
e | |
h | |
c | |
b | |
a | |
d | |
g | |
e | |
h | |
f | |
i |
Does anyone know how to use a txt file like this with debug50, so that we can see each step of the functions as they execute?
I tried running debug50 tideman a b c d e f g h i < Tideman_test.txt , but that did not work
THANKS I WAS ALMOST TO GIVE UP BUT YOUR TEST CODE HELPED ME NOTICE SOMETHING IN MY CODE THAT WAS NOT WORKING IN A SPECIFIC CASE
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for providing this data set and your locked_pairs explanation! It was super helpful and I got the 100 for this seemingly endless problem.

For what it's worth, my algorithm found "e" as the victor.