Skip to main content
The 2024 Developer Survey results are live! See the results

Timeline for Text based tic-tac-toe in bash

Current License: CC BY-SA 4.0

5 events
when toggle format what by license comment
Apr 3 at 11:34 comment added J_H Don't call it test.txt, prefer a name like moves_1.txt. And then the piece you're missing is expected output_1.txt. Definitely use diff -u to compare output. The $? exit code gives you Green vs Red bar result. And lines sent to stdout give you a hint about how to fix the code. Consider echoing a line saying "move N", to help diff properly sync up the two. I suppose that echoing "it is X's turn" might suffice for that.
Apr 3 at 11:25 comment added sbottingota Do you recommend any good ways of automating the unit tests that you mentioned? I guess I could do something like cat test.txt | ./run.sh, where test.txt is a file of the moves separated by newlines, and check to see if the output is correct, but I'm not sure how I would do that automatically.
Apr 3 at 8:07 vote accept sbottingota
Mar 29 at 16:31 history edited J_H CC BY-SA 4.0
add Decomposition section
Mar 28 at 19:50 history answered J_H CC BY-SA 4.0