Created
March 21, 2018 15:00
-
-
Save wtsnjp/8248c01769bbeeb21f383b5a1b423fd8 to your computer and use it in GitHub Desktop.
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
| \makeatletter | |
| \newif\if@wrong\@wrongtrue | |
| \def\CheckAnswer#1{% | |
| \def\x@ans{E394D353A8067671DDDEC726F1D054C8}% | |
| \let\x@tmpa\@empty | |
| \expandafter\@tfor\expandafter\@char\expandafter:\expandafter=\x@ans | |
| \do{\xdef\x@tmpa{\expandafter\x@tmpa\expandafter\string\@char}}% | |
| \xdef\x@tmpb{\pdfmdfivesum{#1}}% | |
| \ifx\x@tmpa\x@tmpb\relax | |
| \@wrongfalse | |
| \typeout{Congratulations!!}% | |
| \@@end | |
| \else | |
| \typeout{Think again :(}% | |
| \fi} | |
| \def\x@chop#1 {#1} | |
| \@whilesw\if@wrong\fi{% | |
| \read16 to \YourAnswer | |
| \xdef\x@tmpa{\expandafter\x@chop\YourAnswer}% | |
| \expandafter\CheckAnswer\expandafter{\x@tmpa}} | |
| \makeatother | |
| % vim: set ft=plaintex: |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
初級者向け LaTeX実力テスト ~キホン編~ の答え合わせ
Usage: (pdf)latex checkanswer.tex