Please ignore secret bonuses. Secret tests do NOT award bonus. Max hw grade is 30+2 bonus efficiency

Do you need help?

Notice Board

Per partecipare al corso di Fondamenti di programmazione 2023-24 loggatevi e attivatelo nella vostra pagina dei corsi preferiti. A quel punto il corso appare nel menù personale cliccando sul proprio avatar. Per i materiali degli anni precedenti seguite lo stesso metodo.

To join the Programming/Lab 2023-24 course, log-on and select it on the my courses page. It will appear on the personal menu of your avatar. For earlier years use the same method.

Test your Code!

Luigi Pizza (6120 points)
14 20 65
in HW6 by (6.1k points)

Hi Guys,

I've noticed a question about changing the value of 'spacing', so I got to work. If you want to test your code against other values This is the code for you!

k = 0

print(ex(r'matrices\example.txt', r'results\result_example.png', 42 + 2*k)==( 288+8*k, 348+8*k))
print(ex(r'matrices\minimal.txt', r'results\result_minimal.png', 30 + k)==(  82+2*k, 140+2*k))
print(ex(r'matrices\mat-3-1.txt', r'results\result_mat-3-1.png', 1 + 48*k)==( 466+864*k, 120+192*k))
print(ex(r'matrices\mat-4-5.txt', r'results\result_mat-4-5.png', 5 + 24*k)==( 120+240*k,  61+120*k))
print(ex(r'matrices\mat-5-5.txt', r'results\result_mat-5-5.png', 5 + 60*k)==( 150+720*k,  78+360*k))
print(ex(r'matrices\mat-2-97.txt', r'results\result_mat-2-97.png', 97 + 4*k)== (690+24*k, 341+12*k))

This works for every value of k, as far as k is a natural number.

Let me know if this has been useful! (You might need to change the path where your files are going to be saved. I've created a folder named results)

484 views

5 Answers

gabrimat (5630 points)
2 4 25
by (5.6k points)
Used them right now, thank you for the extra testing!
Luigi Pizza (6120 points)
14 20 65
by (6.1k points)
You're welcome! I could do the same also for hw8 next time
rokshana03 (16750 points)
1 4 35
by (16.8k points)
Thanks!!! This is gonna be very useful to further test the code I wrote!
Luigi Pizza (6120 points)
14 20 65
by (6.1k points)
You're welcome!
Quellocinese (2700 points)
4 4 22
by (2.7k points)
Thank you so much, let's make no one fail this hw!
Luigi Pizza (6120 points)
14 20 65
by (6.1k points)
You're welcome! Let's hope everybody passes it
James_F (6070 points)
10 14 47
by (6.1k points)
in unix-like system you may need to change the backslash with a regular one '/' to let bash understand what path you are referring to; that said, they seem to work, but i dunno if it may be any useful to test the behavior of our programs.
Noneteless, thank you for sharing!
:D
Simone Russolillo (5790 points)
7 10 22
by (5.8k points)
Sorry Luigi should we add the above code under the command if __name__==__main__?

Thanks in advance.
gabrimat (5630 points)
2 4 25
by (5.6k points)
Yes thore are tests you should run under that condition
Simone Russolillo (5790 points)
7 10 22
by (5.8k points)
thanks Gabriele!
Luigi Pizza (6120 points)
14 20 65
by (6.1k points)
Yes, otherwise they would be executed when imported, slowing the testing (in test_01.py) by a lot.