Post History
Compressed Lua, 214 200 bytes After redoing the code, it turns out that I can do it slightly shorter by optimizing for single letters. There're probably a few more bytes I can shave, but eh… M=0∀...
#3: Post edited
# Compressed Lua, 214 bytesThere are definitely ways to make this slightly terser by messing with priorities, but the Kludge Chain is gonna invade my dreams atp, so have this instead.- ```
M=0∀k∈t:gmatch("[^-]+")⟨m=k:f("y$")∧10∨1 a=k:f("^o")∧1∨k:f("lv")∧12∨k:f("^tw")∧2∨k:f("g")∧8∨k:f("h")∧3∨k:f("u")∧4∨k:f("fi")∧5∨k:f("x")∧6∨k:f("se")∧7∨k:f("ni")∧9∨k:f("ten")∧10∨k:f("le")∧11 M=M+a*m⟩→t:f("een")∧10+M∨M- ```
- Behold its visage! (Sorry for the awful site design. And how long that link is. And the fact that I couldn't even put down all the test cases because I'm a lazy hack.)
- * [Original version][v0]
- [v0]: https://a-a-github-a-a.github.io/playground/golf/clua/?code=M%3D0%E2%88%80k%E2%88%88t%3Agmatch%28%22%5B%5E-%5D%2B%22%29%E2%9F%A8m%3Dk%3Af%28%22y%24%22%29%E2%88%A710%E2%88%A81+a%3Dk%3Af%28%22%5Eo%22%29%E2%88%A71%E2%88%A8k%3Af%28%22lv%22%29%E2%88%A712%E2%88%A8k%3Af%28%22%5Etw%22%29%E2%88%A72%E2%88%A8k%3Af%28%22g%22%29%E2%88%A78%E2%88%A8k%3Af%28%22h%22%29%E2%88%A73%E2%88%A8k%3Af%28%22u%22%29%E2%88%A74%E2%88%A8k%3Af%28%22fi%22%29%E2%88%A75%E2%88%A8k%3Af%28%22x%22%29%E2%88%A76%E2%88%A8k%3Af%28%22se%22%29%E2%88%A77%E2%88%A8k%3Af%28%22ni%22%29%E2%88%A79%E2%88%A8k%3Af%28%22ten%22%29%E2%88%A710%E2%88%A8k%3Af%28%22le%22%29%E2%88%A711+M%3DM%2Ba*m%E2%9F%A9%E2%86%92t%3Af%28%22een%22%29%E2%88%A710%2BM%E2%88%A8M&cases=%5B%5B%22%5C%22one%5C%22%22%2C%221%22%5D%2C%5B%22%5C%22two%5C%22%22%2C%222%22%5D%2C%5B%22%5C%22three%5C%22%22%2C%223%22%5D%2C%5B%22%5C%22four%5C%22%22%2C%224%22%5D%2C%5B%22%5C%22five%5C%22%22%2C%225%22%5D%2C%5B%22%5C%22six%5C%22%22%2C%226%22%5D%2C%5B%22%5C%22seven%5C%22%22%2C%227%22%5D%2C%5B%22%5C%22eight%5C%22%22%2C%228%22%5D%2C%5B%22%5C%22nine%5C%22%22%2C%229%22%5D%2C%5B%22%5C%22ten%5C%22%22%2C%2210%22%5D%2C%5B%22%5C%22eleven%5C%22%22%2C%2211%22%5D%2C%5B%22%5C%22twelve%5C%22%22%2C%2212%22%5D%2C%5B%22%5C%22thirteen%5C%22%22%2C%2213%22%5D%2C%5B%22%5C%22twenty%5C%22%22%2C%2220%22%5D%2C%5B%22%5C%22thirty-two%5C%22%22%2C%2232%22%5D%2C%5B%22%5C%22fourty-seven%5C%22%22%2C%2247%22%5D%2C%5B%22%5C%22fifty-six%5C%22%22%2C%2256%22%5D%2C%5B%22%5C%22sixty-eight%5C%22%22%2C%2268%22%5D%2C%5B%22%5C%22seventy-two%5C%22%22%2C%2272%22%5D%2C%5B%22%5C%22eighty%5C%22%22%2C%2280%22%5D%2C%5B%22%5C%22ninety-one%5C%22%22%2C%2291%22%5D%5D
- # Compressed Lua, <s>214</s> 200 bytes
- After redoing the code, it turns out that I can do it slightly shorter by optimizing for single letters. There're probably a few more bytes I can shave, but eh…
- ```
- M=0∀k∈t:gmatch("[^-]+")⟨m=k:f("y$")∧10∨1 a=k:f("g")∧8∨k:f("h")∧3∨k:f("x")∧6∨k:f("u")∧4∨k:f("lv")∧12∨k:f("^o")∧1∨k:f("^f")∧5∨k:f("w")∧2∨k:f("e$")∧9∨k:f("^t")∧10∨k:f("s")∧7∨11 M=M+a*m⟩→t:f("een")∧10+M∨M
- ```
- Behold its visage! (Sorry for the awful site design. And how long that link is. And the fact that I couldn't even put down all the test cases because I'm a lazy hack.)
- * [Current version (meat redo)][v1]
- * [Original version][v0]
- [v1]: https://a-a-github-a-a.github.io/playground/golf/clua/?code=M%3D0%E2%88%80k%E2%88%88t%3Agmatch%28%22%5B%5E-%5D%2B%22%29%E2%9F%A8m%3Dk%3Af%28%22y%24%22%29%E2%88%A710%E2%88%A81+a%3Dk%3Af%28%22g%22%29%E2%88%A78%E2%88%A8k%3Af%28%22h%22%29%E2%88%A73%E2%88%A8k%3Af%28%22x%22%29%E2%88%A76%E2%88%A8k%3Af%28%22u%22%29%E2%88%A74%E2%88%A8k%3Af%28%22lv%22%29%E2%88%A712%E2%88%A8k%3Af%28%22%5Eo%22%29%E2%88%A71%E2%88%A8k%3Af%28%22%5Ef%22%29%E2%88%A75%E2%88%A8k%3Af%28%22w%22%29%E2%88%A72%E2%88%A8k%3Af%28%22e%24%22%29%E2%88%A79%E2%88%A8k%3Af%28%22%5Et%22%29%E2%88%A710%E2%88%A8k%3Af%28%22s%22%29%E2%88%A77%E2%88%A811+M%3DM%2Ba*m%E2%9F%A9%E2%86%92t%3Af%28%22een%22%29%E2%88%A710%2BM%E2%88%A8M&cases=%5B%5B%22%5C%22one%5C%22%22%2C%221%22%5D%2C%5B%22%5C%22two%5C%22%22%2C%222%22%5D%2C%5B%22%5C%22three%5C%22%22%2C%223%22%5D%2C%5B%22%5C%22four%5C%22%22%2C%224%22%5D%2C%5B%22%5C%22five%5C%22%22%2C%225%22%5D%2C%5B%22%5C%22six%5C%22%22%2C%226%22%5D%2C%5B%22%5C%22seven%5C%22%22%2C%227%22%5D%2C%5B%22%5C%22eight%5C%22%22%2C%228%22%5D%2C%5B%22%5C%22nine%5C%22%22%2C%229%22%5D%2C%5B%22%5C%22ten%5C%22%22%2C%2210%22%5D%2C%5B%22%5C%22eleven%5C%22%22%2C%2211%22%5D%2C%5B%22%5C%22twelve%5C%22%22%2C%2212%22%5D%2C%5B%22%5C%22thirteen%5C%22%22%2C%2213%22%5D%2C%5B%22%5C%22twenty%5C%22%22%2C%2220%22%5D%2C%5B%22%5C%22thirty-two%5C%22%22%2C%2232%22%5D%2C%5B%22%5C%22fourty-seven%5C%22%22%2C%2247%22%5D%2C%5B%22%5C%22fifty-six%5C%22%22%2C%2256%22%5D%2C%5B%22%5C%22sixty-eight%5C%22%22%2C%2268%22%5D%2C%5B%22%5C%22seventy-two%5C%22%22%2C%2272%22%5D%2C%5B%22%5C%22eighty%5C%22%22%2C%2280%22%5D%2C%5B%22%5C%22ninety-one%5C%22%22%2C%2291%22%5D%5D
- [v0]: https://a-a-github-a-a.github.io/playground/golf/clua/?code=M%3D0%E2%88%80k%E2%88%88t%3Agmatch%28%22%5B%5E-%5D%2B%22%29%E2%9F%A8m%3Dk%3Af%28%22y%24%22%29%E2%88%A710%E2%88%A81+a%3Dk%3Af%28%22%5Eo%22%29%E2%88%A71%E2%88%A8k%3Af%28%22lv%22%29%E2%88%A712%E2%88%A8k%3Af%28%22%5Etw%22%29%E2%88%A72%E2%88%A8k%3Af%28%22g%22%29%E2%88%A78%E2%88%A8k%3Af%28%22h%22%29%E2%88%A73%E2%88%A8k%3Af%28%22u%22%29%E2%88%A74%E2%88%A8k%3Af%28%22fi%22%29%E2%88%A75%E2%88%A8k%3Af%28%22x%22%29%E2%88%A76%E2%88%A8k%3Af%28%22se%22%29%E2%88%A77%E2%88%A8k%3Af%28%22ni%22%29%E2%88%A79%E2%88%A8k%3Af%28%22ten%22%29%E2%88%A710%E2%88%A8k%3Af%28%22le%22%29%E2%88%A711+M%3DM%2Ba*m%E2%9F%A9%E2%86%92t%3Af%28%22een%22%29%E2%88%A710%2BM%E2%88%A8M&cases=%5B%5B%22%5C%22one%5C%22%22%2C%221%22%5D%2C%5B%22%5C%22two%5C%22%22%2C%222%22%5D%2C%5B%22%5C%22three%5C%22%22%2C%223%22%5D%2C%5B%22%5C%22four%5C%22%22%2C%224%22%5D%2C%5B%22%5C%22five%5C%22%22%2C%225%22%5D%2C%5B%22%5C%22six%5C%22%22%2C%226%22%5D%2C%5B%22%5C%22seven%5C%22%22%2C%227%22%5D%2C%5B%22%5C%22eight%5C%22%22%2C%228%22%5D%2C%5B%22%5C%22nine%5C%22%22%2C%229%22%5D%2C%5B%22%5C%22ten%5C%22%22%2C%2210%22%5D%2C%5B%22%5C%22eleven%5C%22%22%2C%2211%22%5D%2C%5B%22%5C%22twelve%5C%22%22%2C%2212%22%5D%2C%5B%22%5C%22thirteen%5C%22%22%2C%2213%22%5D%2C%5B%22%5C%22twenty%5C%22%22%2C%2220%22%5D%2C%5B%22%5C%22thirty-two%5C%22%22%2C%2232%22%5D%2C%5B%22%5C%22fourty-seven%5C%22%22%2C%2247%22%5D%2C%5B%22%5C%22fifty-six%5C%22%22%2C%2256%22%5D%2C%5B%22%5C%22sixty-eight%5C%22%22%2C%2268%22%5D%2C%5B%22%5C%22seventy-two%5C%22%22%2C%2272%22%5D%2C%5B%22%5C%22eighty%5C%22%22%2C%2280%22%5D%2C%5B%22%5C%22ninety-one%5C%22%22%2C%2291%22%5D%5D
#2: Post edited
# Compressed Lua, 237 bytes- There are definitely ways to make this slightly terser by messing with priorities, but the Kludge Chain is gonna invade my dreams atp, so have this instead.
- ```
¿t≡"twelve"ː→12⟩M=0∀k∈t:gmatch("[^-]+")⟨m=k:f("y$")∧10∨1 a=k:f("^o")∧1∨k:f("lv")∧12∨k:f("^tw")∧2∨k:f("g")∧8∨k:f("h")∧3∨k:f("u")∧4∨k:f("fi")∧5∨k:f("x")∧6∨k:f("se")∧7∨k:f("ni")∧9∨k:f("ten")∧10∨k:f("le")∧11 M=M+a*m⟩→t:f("een")∧10+M∨M- ```
- Behold its visage! (Sorry for the awful site design. And how long that link is. And the fact that I couldn't even put down all the test cases because I'm a lazy hack.)
- * [Original version][v0]
[v0]: https://a-a-github-a-a.github.io/playground/golf/clua/?code=%C2%BFt%E2%89%A1%22twelve%22%CB%90%E2%86%9212%E2%9F%A9M%3D0%E2%88%80k%E2%88%88t%3Agmatch%28%22%5B%5E-%5D%2B%22%29%E2%9F%A8m%3Dk%3Af%28%22y%24%22%29%E2%88%A710%E2%88%A81+a%3Dk%3Af%28%22%5Eo%22%29%E2%88%A71%E2%88%A8k%3Af%28%22lv%22%29%E2%88%A712%E2%88%A8k%3Af%28%22%5Etw%22%29%E2%88%A72%E2%88%A8k%3Af%28%22g%22%29%E2%88%A78%E2%88%A8k%3Af%28%22h%22%29%E2%88%A73%E2%88%A8k%3Af%28%22u%22%29%E2%88%A74%E2%88%A8k%3Af%28%22fi%22%29%E2%88%A75%E2%88%A8k%3Af%28%22x%22%29%E2%88%A76%E2%88%A8k%3Af%28%22se%22%29%E2%88%A77%E2%88%A8k%3Af%28%22ni%22%29%E2%88%A79%E2%88%A8k%3Af%28%22ten%22%29%E2%88%A710%E2%88%A8k%3Af%28%22le%22%29%E2%88%A711+M%3DM%2Ba*m%E2%9F%A9%E2%86%92t%3Af%28%22een%22%29%E2%88%A710%2BM%E2%88%A8M&cases=%5B%5B%22%5C%22one%5C%22%22%2C%221%22%5D%2C%5B%22%5C%22two%5C%22%22%2C%222%22%5D%2C%5B%22%5C%22three%5C%22%22%2C%223%22%5D%2C%5B%22%5C%22four%5C%22%22%2C%224%22%5D%2C%5B%22%5C%22five%5C%22%22%2C%225%22%5D%2C%5B%22%5C%22six%5C%22%22%2C%226%22%5D%2C%5B%22%5C%22seven%5C%22%22%2C%227%22%5D%2C%5B%22%5C%22eight%5C%22%22%2C%228%22%5D%2C%5B%22%5C%22nine%5C%22%22%2C%229%22%5D%2C%5B%22%5C%22ten%5C%22%22%2C%2210%22%5D%2C%5B%22%5C%22eleven%5C%22%22%2C%2211%22%5D%2C%5B%22%5C%22twelve%5C%22%22%2C%2212%22%5D%2C%5B%22%5C%22thirteen%5C%22%22%2C%2213%22%5D%2C%5B%22%5C%22twenty%5C%22%22%2C%2220%22%5D%2C%5B%22%5C%22thirty-two%5C%22%22%2C%2232%22%5D%2C%5B%22%5C%22fourty-seven%5C%22%22%2C%2247%22%5D%2C%5B%22%5C%22fifty-six%5C%22%22%2C%2256%22%5D%2C%5B%22%5C%22sixty-eight%5C%22%22%2C%2268%22%5D%2C%5B%22%5C%22seventy-two%5C%22%22%2C%2272%22%5D%2C%5B%22%5C%22eighty%5C%22%22%2C%2280%22%5D%2C%5B%22%5C%22ninety-one%5C%22%22%2C%2291%22%5D%5D
- # Compressed Lua, 214 bytes
- There are definitely ways to make this slightly terser by messing with priorities, but the Kludge Chain is gonna invade my dreams atp, so have this instead.
- ```
- M=0∀k∈t:gmatch("[^-]+")⟨m=k:f("y$")∧10∨1 a=k:f("^o")∧1∨k:f("lv")∧12∨k:f("^tw")∧2∨k:f("g")∧8∨k:f("h")∧3∨k:f("u")∧4∨k:f("fi")∧5∨k:f("x")∧6∨k:f("se")∧7∨k:f("ni")∧9∨k:f("ten")∧10∨k:f("le")∧11 M=M+a*m⟩→t:f("een")∧10+M∨M
- ```
- Behold its visage! (Sorry for the awful site design. And how long that link is. And the fact that I couldn't even put down all the test cases because I'm a lazy hack.)
- * [Original version][v0]
- [v0]: https://a-a-github-a-a.github.io/playground/golf/clua/?code=M%3D0%E2%88%80k%E2%88%88t%3Agmatch%28%22%5B%5E-%5D%2B%22%29%E2%9F%A8m%3Dk%3Af%28%22y%24%22%29%E2%88%A710%E2%88%A81+a%3Dk%3Af%28%22%5Eo%22%29%E2%88%A71%E2%88%A8k%3Af%28%22lv%22%29%E2%88%A712%E2%88%A8k%3Af%28%22%5Etw%22%29%E2%88%A72%E2%88%A8k%3Af%28%22g%22%29%E2%88%A78%E2%88%A8k%3Af%28%22h%22%29%E2%88%A73%E2%88%A8k%3Af%28%22u%22%29%E2%88%A74%E2%88%A8k%3Af%28%22fi%22%29%E2%88%A75%E2%88%A8k%3Af%28%22x%22%29%E2%88%A76%E2%88%A8k%3Af%28%22se%22%29%E2%88%A77%E2%88%A8k%3Af%28%22ni%22%29%E2%88%A79%E2%88%A8k%3Af%28%22ten%22%29%E2%88%A710%E2%88%A8k%3Af%28%22le%22%29%E2%88%A711+M%3DM%2Ba*m%E2%9F%A9%E2%86%92t%3Af%28%22een%22%29%E2%88%A710%2BM%E2%88%A8M&cases=%5B%5B%22%5C%22one%5C%22%22%2C%221%22%5D%2C%5B%22%5C%22two%5C%22%22%2C%222%22%5D%2C%5B%22%5C%22three%5C%22%22%2C%223%22%5D%2C%5B%22%5C%22four%5C%22%22%2C%224%22%5D%2C%5B%22%5C%22five%5C%22%22%2C%225%22%5D%2C%5B%22%5C%22six%5C%22%22%2C%226%22%5D%2C%5B%22%5C%22seven%5C%22%22%2C%227%22%5D%2C%5B%22%5C%22eight%5C%22%22%2C%228%22%5D%2C%5B%22%5C%22nine%5C%22%22%2C%229%22%5D%2C%5B%22%5C%22ten%5C%22%22%2C%2210%22%5D%2C%5B%22%5C%22eleven%5C%22%22%2C%2211%22%5D%2C%5B%22%5C%22twelve%5C%22%22%2C%2212%22%5D%2C%5B%22%5C%22thirteen%5C%22%22%2C%2213%22%5D%2C%5B%22%5C%22twenty%5C%22%22%2C%2220%22%5D%2C%5B%22%5C%22thirty-two%5C%22%22%2C%2232%22%5D%2C%5B%22%5C%22fourty-seven%5C%22%22%2C%2247%22%5D%2C%5B%22%5C%22fifty-six%5C%22%22%2C%2256%22%5D%2C%5B%22%5C%22sixty-eight%5C%22%22%2C%2268%22%5D%2C%5B%22%5C%22seventy-two%5C%22%22%2C%2272%22%5D%2C%5B%22%5C%22eighty%5C%22%22%2C%2280%22%5D%2C%5B%22%5C%22ninety-one%5C%22%22%2C%2291%22%5D%5D
#1: Initial revision
# Compressed Lua, 237 bytes
There are definitely ways to make this slightly terser by messing with priorities, but the Kludge Chain is gonna invade my dreams atp, so have this instead.
```
¿t≡"twelve"ː→12⟩M=0∀k∈t:gmatch("[^-]+")⟨m=k:f("y$")∧10∨1 a=k:f("^o")∧1∨k:f("lv")∧12∨k:f("^tw")∧2∨k:f("g")∧8∨k:f("h")∧3∨k:f("u")∧4∨k:f("fi")∧5∨k:f("x")∧6∨k:f("se")∧7∨k:f("ni")∧9∨k:f("ten")∧10∨k:f("le")∧11 M=M+a*m⟩→t:f("een")∧10+M∨M
```
Behold its visage! (Sorry for the awful site design. And how long that link is. And the fact that I couldn't even put down all the test cases because I'm a lazy hack.)
* [Original version][v0]
[v0]: https://a-a-github-a-a.github.io/playground/golf/clua/?code=%C2%BFt%E2%89%A1%22twelve%22%CB%90%E2%86%9212%E2%9F%A9M%3D0%E2%88%80k%E2%88%88t%3Agmatch%28%22%5B%5E-%5D%2B%22%29%E2%9F%A8m%3Dk%3Af%28%22y%24%22%29%E2%88%A710%E2%88%A81+a%3Dk%3Af%28%22%5Eo%22%29%E2%88%A71%E2%88%A8k%3Af%28%22lv%22%29%E2%88%A712%E2%88%A8k%3Af%28%22%5Etw%22%29%E2%88%A72%E2%88%A8k%3Af%28%22g%22%29%E2%88%A78%E2%88%A8k%3Af%28%22h%22%29%E2%88%A73%E2%88%A8k%3Af%28%22u%22%29%E2%88%A74%E2%88%A8k%3Af%28%22fi%22%29%E2%88%A75%E2%88%A8k%3Af%28%22x%22%29%E2%88%A76%E2%88%A8k%3Af%28%22se%22%29%E2%88%A77%E2%88%A8k%3Af%28%22ni%22%29%E2%88%A79%E2%88%A8k%3Af%28%22ten%22%29%E2%88%A710%E2%88%A8k%3Af%28%22le%22%29%E2%88%A711+M%3DM%2Ba*m%E2%9F%A9%E2%86%92t%3Af%28%22een%22%29%E2%88%A710%2BM%E2%88%A8M&cases=%5B%5B%22%5C%22one%5C%22%22%2C%221%22%5D%2C%5B%22%5C%22two%5C%22%22%2C%222%22%5D%2C%5B%22%5C%22three%5C%22%22%2C%223%22%5D%2C%5B%22%5C%22four%5C%22%22%2C%224%22%5D%2C%5B%22%5C%22five%5C%22%22%2C%225%22%5D%2C%5B%22%5C%22six%5C%22%22%2C%226%22%5D%2C%5B%22%5C%22seven%5C%22%22%2C%227%22%5D%2C%5B%22%5C%22eight%5C%22%22%2C%228%22%5D%2C%5B%22%5C%22nine%5C%22%22%2C%229%22%5D%2C%5B%22%5C%22ten%5C%22%22%2C%2210%22%5D%2C%5B%22%5C%22eleven%5C%22%22%2C%2211%22%5D%2C%5B%22%5C%22twelve%5C%22%22%2C%2212%22%5D%2C%5B%22%5C%22thirteen%5C%22%22%2C%2213%22%5D%2C%5B%22%5C%22twenty%5C%22%22%2C%2220%22%5D%2C%5B%22%5C%22thirty-two%5C%22%22%2C%2232%22%5D%2C%5B%22%5C%22fourty-seven%5C%22%22%2C%2247%22%5D%2C%5B%22%5C%22fifty-six%5C%22%22%2C%2256%22%5D%2C%5B%22%5C%22sixty-eight%5C%22%22%2C%2268%22%5D%2C%5B%22%5C%22seventy-two%5C%22%22%2C%2272%22%5D%2C%5B%22%5C%22eighty%5C%22%22%2C%2280%22%5D%2C%5B%22%5C%22ninety-one%5C%22%22%2C%2291%22%5D%5D
