Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Challenges

Post History

71%
+3 −0
Challenges Collatz conjecture; Count the tries to reach $1$

Sclipting, (UTF-16) 44 34 32 bytes 貶要❶갠剩❷隔❸增갰乘嗎終并長貶 Because comparing with 1 is expensive (requires copying and decrementing), we instead use a modified version of the Collatz sequence - namely...

posted 2y ago by Moshi‭  ·  edited 2y ago by Moshi‭

Answer
#3: Post edited by user avatar Moshi‭ · 2021-09-16T22:29:11Z (over 2 years ago)
  • # [Sclipting], (UTF-16) ~~44~~ [34 bytes][Byte count]
  • ```
  • 貶要⓶增⓶❶갠剩是隔不增갰乘終終丟
  • ```
  • Because comparing with 1 is expensive (requires copying and decrementing), we instead use a modified version of the Collatz sequence - namely, we use the sequence where every number is one lower. This allows us to compare with 0 instead.
  • ```text
  • Input of n
  • 貶 Decrement n
  • 要 While n (is non-zero)
  • ⓶增⓶ Increment the counter
  • ❶갠剩 Take mod 2
  • If truthy (odd)
  • 隔 Integer divide by 2
  • 不 Else
  • 增갰乘 Add 1 and multiply by 3
  • End if
  • 終 End while
  • 丟 Drop n, leaving only the counter
  • ```
  • [Sclipting]: https://esolangs.org/wiki/Sclipting
  • [Byte count]: https://ethproductions.github.io/bytes/?e=utf-16&t=%E8%B2%B6%E8%A6%81%E2%93%B6%E5%A2%9E%E2%93%B6%E2%9D%B6%EA%B0%A0%E5%89%A9%E6%98%AF%E9%9A%94%E4%B8%8D%E5%A2%9E%EA%B0%B0%E4%B9%98%E7%B5%82%E7%B5%82%E4%B8%9F
  • # [Sclipting], (UTF-16) ~~44~~ ~~34~~ [32 bytes][Byte count]
  • ```
  • 貶要❶갠剩❷隔❸增갰乘嗎終并長貶
  • ```
  • Because comparing with 1 is expensive (requires copying and decrementing), we instead use a modified version of the Collatz sequence - namely, we use the sequence where every number is one lower. This allows us to compare with 0 instead.
  • ```text
  • Input of n
  • 貶 Decrement n
  • 要 While n (is non-zero)
  • ❶갠剩 Take n mod 2
  • ❷隔 Compute n integer divided by 2 (1)
  • 增갰乘 Compute n plus 1 and multiplied by 3 (2)
  • Condition on n mod 2; if odd, take (1) else take (2)
  • 終 End while
  • 并長貶 Join stack into a list, take the length and decrement by one
  • ```
  • [Sclipting]: https://esolangs.org/wiki/Sclipting
  • [Byte count]: https://ethproductions.github.io/bytes/?e=utf-16&t=%E8%B2%B6%E8%A6%81%E2%9D%B6%EA%B0%A0%E5%89%A9%E2%9D%B7%E9%9A%94%E2%9D%B8%E5%A2%9E%EA%B0%B0%E4%B9%98%E5%97%8E%E7%B5%82%E5%B9%B6%E9%95%B7%E8%B2%B6
#2: Post edited by user avatar Moshi‭ · 2021-09-15T21:50:33Z (over 2 years ago)
  • # [Sclipting], [(UTF-16) 44 bytes][Byte count]
  • ```
  • 가⓶❶⓶增⓶❶갠剩是갰乘增不半終❶貶終丟
  • ```
  • [Sclipting]: https://esolangs.org/wiki/Sclipting
  • [Byte count]: https://ethproductions.github.io/bytes/?e=utf-16&t=%EA%B0%80%E2%93%B6%E2%9D%B6%E8%B2%B6%E5%A5%97%E2%93%B6%E5%A2%9E%E2%93%B6%E2%9D%B6%EA%B0%A0%E5%89%A9%E6%98%AF%EA%B0%B0%E4%B9%98%E5%A2%9E%E4%B8%8D%E5%8D%8A%E7%B5%82%E2%9D%B6%E8%B2%B6%E7%B5%82%E4%B8%9F
  • # [Sclipting], (UTF-16) ~~44~~ [34 bytes][Byte count]
  • ```
  • ⓶增⓶❶갠剩是隔不增갰乘終終丟
  • ```
  • Because comparing with 1 is expensive (requires copying and decrementing), we instead use a modified version of the Collatz sequence - namely, we use the sequence where every number is one lower. This allows us to compare with 0 instead.
  • ```text
  • Input of n
  • 貶 Decrement n
  • 要 While n (is non-zero)
  • ⓶增⓶ Increment the counter
  • ❶갠剩 Take mod 2
  • 是 If truthy (odd)
  • 隔 Integer divide by 2
  • 不 Else
  • 增갰乘 Add 1 and multiply by 3
  • 終 End if
  • 終 End while
  • 丟 Drop n, leaving only the counter
  • ```
  • [Sclipting]: https://esolangs.org/wiki/Sclipting
  • [Byte count]: https://ethproductions.github.io/bytes/?e=utf-16&t=%E8%B2%B6%E8%A6%81%E2%93%B6%E5%A2%9E%E2%93%B6%E2%9D%B6%EA%B0%A0%E5%89%A9%E6%98%AF%E9%9A%94%E4%B8%8D%E5%A2%9E%EA%B0%B0%E4%B9%98%E7%B5%82%E7%B5%82%E4%B8%9F
#1: Initial revision by user avatar Moshi‭ · 2021-09-14T21:49:46Z (over 2 years ago)
# [Sclipting], [(UTF-16) 44 bytes][Byte count]

```
가⓶❶貶套⓶增⓶❶갠剩是갰乘增不半終❶貶終丟
```

[Sclipting]: https://esolangs.org/wiki/Sclipting
[Byte count]: https://ethproductions.github.io/bytes/?e=utf-16&t=%EA%B0%80%E2%93%B6%E2%9D%B6%E8%B2%B6%E5%A5%97%E2%93%B6%E5%A2%9E%E2%93%B6%E2%9D%B6%EA%B0%A0%E5%89%A9%E6%98%AF%EA%B0%B0%E4%B9%98%E5%A2%9E%E4%B8%8D%E5%8D%8A%E7%B5%82%E2%9D%B6%E8%B2%B6%E7%B5%82%E4%B8%9F