![]() |
.. (לתיקייה המכילה) | |
Can we use the "exit" function in this exercise? | |
Yes but it is not recommended. return; from main is much more neat and leads to better and more maintainable code. (why?) |
Can we #include stdlib.h for exit? | |
Yes (how would you use it otherwise?), but its use is strongly discouraged |
Can we use assert.h? | |
Yes, it is recommended (but won't help you in solving). |
What is assert? | |
It is out of scope and not required. Basically, if its argument is false it crashes the program and reports the line and failed condition. As such, it is useful for test-time sanity checks. |
Why does my email not got answered? | |
You're at the right place. See if your issue has already been addressed here. If it was, but answer is unclear - please note that (and what exactly is unclear) in your email. Also please make sure your mail subject is exactly in the format requested in the exercise (which it should anyway be in a polite mail). We get a lot of emails, and the small effort from your side in writing a formatted and informative subject allows us to more efficiently process them and you get faster answers. |
Which material is allowed - up to tutorial 5 or tutorial 7? | |
Up to and including 7 (you may use pointers), although material required is mostly up to 5. In particular, dynamic allocation is not needed in this exercise. |
May we edit the provided code / implement our own versions? | |
Yes, as long as your output matches exercise requirements and expected output, and your code the required conventions and design principles. |
Clarification on line counting | |
in C language statements are separated with a semicolon (';') thus each semicolon counts as a line of code (except inside a for command). condition parentheses also count as a line of code. Concatenation of operators and function calls is not an exemption (one line of code per semicolon) You are allowed to use up to 150 characters per line |
Can I use pointers? | |
Pointers are not needed to solve this assignment. |
Where should I write comments? | |
The rule of thumb: If you need comments - your function/variable names are not informative enough. In a few limited cases you need to comment on a piece of code. Comments are measured for line length too!! |
Tests failed on csm, but everything works fine if I run locally on my machine (redirection or manually). What could be the problem? | |
There are two kind of problems: first, accessing arrays out-of-bounds. CodeBlocks let you do this, linux-gcc will not [tests crashed, and possibly no csm output] second, '\n' on Windows machines is different from '\n' (new line) on linux. Try to not read those characters at all. If you were asked to read numbers - do only this. Do not try to consume all those white spaces. |
Can we use stdlib.h? | |
Not needed. |
Is it possible to undo an Undo? | |
No. Undo takes the game from current state [which is at step k] back s steps [to step k - s]. Undo is never a step in a game, it merely takes the game back in time. |
What should I do with the printing functions that you provide? | |
Add these functions to your code file, and use them for printing (you can edit them) |
When I use the printing functions that you provide us on my computer, there is still a difference between the test file and the output from my program in EOF or end of line. | |
There might be a difference because of different operating system, if the tests in the website pass the difference is unimportant. The website tests determine the grade. |
If the player did illegal undo, does it means that he will continue to try undo until it will be legal? | |
No, the player can do illegal undo and then try a regular step in the new try. |
Do we need to define ‘X’ and ‘O’? | |
Yes. Those are constants. |
Which number should we set in “define”? | |
Every number that is not 0 or 1. |