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

60%
+1 −0
Challenges Looping counter

K (oK), 9 bytes {x#0}'!10 Try it online! !10 / pass range your arbitrary number .' / treat those as a list, and evaluate each separately { } / main function...

posted 7mo ago by xrs‭  ·  edited 4mo ago by xrs‭

Answer
#4: Post edited by user avatar xrs‭ · 2024-08-20T21:05:03Z (4 months ago)
  • # [K (oK)], 11 bytes
  • {x#0}'(!10)
  • [Try it online!][TIO-lwwszyyw]
  • [K (oK)]: https://github.com/JohnEarnest/ok
  • [TIO-lwwszyyw]: https://tio.run/##y9bNz/7/v7pC2aBWXUPR0EDz/38A "K (oK) – Try It Online"
  • It has taken me days to get here. This is the previous iteration. Was able to tighten it up by switching to int instead of char.
  • (!10) / pass range from 0 to 9 (or your arbitrary number)
  • .' / treat those as a list, and evaluate each separately
  • { } / main function
  • x / number passed from the list
  • # / will be 'counted' x many times
  • "*" / printing the asterisk each time
  • # [K (oK)], 9 bytes
  • {x#0}'!10
  • [Try it online!][TIO-m02wxa02]
  • [K (oK)]: https://github.com/JohnEarnest/ok
  • [TIO-m02wxa02]: https://tio.run/##y9bNz/7/v7pC2aBWXdHQ4P9/AA "K (oK) – Try It Online"
  • !10 / pass range your arbitrary number
  • .' / treat those as a list, and evaluate each separately
  • { } / main function
  • x / number passed from the list
  • # / will be 'counted' x many times
  • 0 / printing the 0 each time
#3: Post edited by user avatar xrs‭ · 2024-06-02T00:29:47Z (7 months ago)
  • # [K (oK)], 14 bytes
  • {x#"*"}.'(!10)
  • [Try it online!][TIO-lws6lix5]
  • [K (oK)]: https://github.com/JohnEarnest/ok
  • [TIO-lws6lix5]: https://tio.run/##y9bNz/7/v7pCWUlLqVZPXUPR0EDz/39TAA "K (oK) – Try It Online"
  • It has taken me days to get here.
  • (!10) / pass range from 0 to 9 (or your arbitrary number)
  • .' / treat those as a list, and evaluate each separately
  • { } / main function
  • x / number passed from the list
  • # / will be 'counted' x many times
  • "*" / printing the asterisk each time
  • # [K (oK)], 11 bytes
  • {x#0}'(!10)
  • [Try it online!][TIO-lwwszyyw]
  • [K (oK)]: https://github.com/JohnEarnest/ok
  • [TIO-lwwszyyw]: https://tio.run/##y9bNz/7/v7pC2aBWXUPR0EDz/38A "K (oK) – Try It Online"
  • It has taken me days to get here. This is the previous iteration. Was able to tighten it up by switching to int instead of char.
  • (!10) / pass range from 0 to 9 (or your arbitrary number)
  • .' / treat those as a list, and evaluate each separately
  • { } / main function
  • x / number passed from the list
  • # / will be 'counted' x many times
  • "*" / printing the asterisk each time
#2: Post edited by user avatar xrs‭ · 2024-05-29T19:42:52Z (7 months ago)
  • # [K (oK)], 14 bytes
  • {x#"*"}.'(!10)
  • [Try it online!][TIO-lws6lix5]
  • [K (oK)]: https://github.com/JohnEarnest/ok
  • [TIO-lws6lix5]: https://tio.run/##y9bNz/7/v7pCWUlLqVZPXUPR0EDz/39TAA "K (oK) – Try It Online"
  • It has taken me days to get here.
  • (!10) / pass numbers from 0 to 9 (ten in total)
  • .' / treat those as a list, and evaluate each separately
  • { } / main function
  • x / number passed from the list
  • # / will be 'counted' x many times
  • "*" / printing the asterisk each time
  • # [K (oK)], 14 bytes
  • {x#"*"}.'(!10)
  • [Try it online!][TIO-lws6lix5]
  • [K (oK)]: https://github.com/JohnEarnest/ok
  • [TIO-lws6lix5]: https://tio.run/##y9bNz/7/v7pCWUlLqVZPXUPR0EDz/39TAA "K (oK) – Try It Online"
  • It has taken me days to get here.
  • (!10) / pass range from 0 to 9 (or your arbitrary number)
  • .' / treat those as a list, and evaluate each separately
  • { } / main function
  • x / number passed from the list
  • # / will be 'counted' x many times
  • "*" / printing the asterisk each time
#1: Initial revision by user avatar xrs‭ · 2024-05-29T18:59:09Z (7 months ago)
# [K (oK)], 14 bytes

    {x#"*"}.'(!10)

[Try it online!][TIO-lws6lix5]

[K (oK)]: https://github.com/JohnEarnest/ok
[TIO-lws6lix5]: https://tio.run/##y9bNz/7/v7pCWUlLqVZPXUPR0EDz/39TAA "K (oK) – Try It Online"

It has taken me days to get here.

             (!10) / pass numbers from 0 to 9 (ten in total)
           .'      / treat those as a list, and evaluate each separately
    {     }        / main function
     x             / number passed from the list
      #            / will be 'counted' x many times
       "*"         / printing the asterisk each time