python - A question about a doctest-similar thing in the hog project of UCB CS61A - Stack Overflow

I am working on the hog project from UCB CS61A. Your can find the info about this project here.In this

I am working on the hog project from UCB CS61A. Your can find the info about this project here.

In this project, one is required to write a roll_dice(num_rolls,dice) function and then test it using their autograder. Info about the autograder can be found here.

I checked the test scripts and find something like

>>> roll_dice(2, make_test_dice(4, 6, 1))
8a27d52d885dfcd62a4a92cbfe64d30a

For anyone who want to check this, you can download hog.zip from the above link. Unzip the file into folder hog, then you can find the above script in \hog\tests\01.py

This looks super like a doctest. However, if I do treat it like a doctest and run

import doctest
doctest.testmod()

It failed obviously as the expected answer is 10 rather than the mysterious 8a27d52d885dfcd62a4a92cbfe64d30a. But it works if I run the test with their autograder.

I am just super curious about what is going on. Is that a mysterious way to encrypt? I am relatively new to CS, so please bear with me if this is an uninteresting question.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745110390a4611812.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信