[閒聊] Error quine

作者: fxfxxxfxx (愛麗絲)   2022-09-25 17:43:13
寫一個程式,丟給 compiler/interpreter/runtime 時
會產生和原本程式一模一樣的 error message
https://codegolf.stackexchange.com/questions/36260
像JavaScript (在我Chrome的console):
> Uncaught SyntaxError: Unexpected identifier 'SyntaxError'
(x) Uncaught SyntaxError: Unexpected identifier 'SyntaxError'
Error message 和餵進去的程式一模一樣
不過這個挑戰好像有點簡單
因為compiler/interpreter 幾本上遇到 syntax error 就直接停下來了
不會管剩下的東西
所以後面就照著打就好
難度和正規的quine,
也就是會印出自己程式碼的程式難度完全不一樣

Links booklink

Contact Us: admin [ a t ] ucptt.com