JSFiddle - React, Tailwind, and code Playground
by antfu
HTML
<script src="https://unpkg.com/@wenyanlang/runtime"></script>
<script type="application/wenyan" scoped>
吾有一術。名之曰「斐氏列」。
欲行是術。必先得一數。曰「因」。乃行是術曰。
有數零。名之曰「頭」。
有數一。名之曰「尾」。
有數一。名之曰「計」。
有數零。名之曰「果」。
若「因」等於零者。昔之「果」者。今「因」是矣云云。
若「因」等於一者。昔之「果」者。今「因」是矣云云。
恆為是。若「計」不小於「因」者乃止也。
加「頭」以「尾」。昔之「果」者。今其是矣。
昔之「頭」者。今「尾」是矣。
昔之「尾」者。今「果」是矣。
加「計」以一。昔之「計」者。今其是矣。
云云。
乃得「果」
是謂「斐氏列」之術也。
施「斐氏列」於十。書之。
</script>
<script type="application/wenyan">
吾有一數。曰三。名之曰「甲」。
為是「甲」遍。
吾有一言。曰「「問天地好在。」」。書之。
云云。
</script>
<script type="application/wenyan">
施「((title)=>document.title=title)」於「「文言」」。
施「((text)=>document.body.innerText=text)」於「「問天地好在。」」。
</script>
<script type="application/wenyan" src="https://raw.githubusercontent.com/LingDong-/wenyan-lang/master/examples/tree2.wy"></script>
<div id="out">
</div>
JavaScript
// Please check the console output