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 Roll n fair dice

Japt -mx, 3 bytes Takes n as the first input and m as the second. ÒVö Try it ÒVö :Implicit map of the range [0,first input) Ò :Negate the bitwise NOT of (i.e., increment) V ...

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

Answer
#3: Post edited by user avatar Shaggy‭ · 2021-08-27T10:22:55Z (over 2 years ago)
  • # [Japt](https://github.com/ETHproductions/japt) [`-mx`](https://codegolf.meta.stackexchange.com/a/14339/), 3 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Takes `n` as the first input and `m` as the second.
  • ÒVö
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LW14&code=0lb2&input=Mgo2)
  • # [Japt](https://github.com/ETHproductions/japt) [`-mx`](https://codegolf.meta.stackexchange.com/a/14339/), 3 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Takes `n` as the first input and `m` as the second.
  • ÒVö
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LW14&code=0lb2&input=Mgo2)
  • ÒVö :Implicit map of the range [0,first input)
  • Ò :Negate the bitwise NOT of (i.e., increment)
  • V :Second input
  • ö :Random int in range [0,V)
  • :Implicit output of sum of resulting array
#2: Post edited by user avatar Shaggy‭ · 2021-08-26T08:28:27Z (over 2 years ago)
  • # [Japt](https://github.com/ETHproductions/japt) [`-mx`](https://codegolf.meta.stackexchange.com/a/14339/), 3 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • ÒVö
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LW14&code=0lb2&input=Mgo2)
  • # [Japt](https://github.com/ETHproductions/japt) [`-mx`](https://codegolf.meta.stackexchange.com/a/14339/), 3 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Takes `n` as the first input and `m` as the second.
  • ÒVö
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LW14&code=0lb2&input=Mgo2)
#1: Initial revision by user avatar Shaggy‭ · 2021-08-26T08:27:46Z (over 2 years ago)
# [Japt](https://github.com/ETHproductions/japt) [`-mx`](https://codegolf.meta.stackexchange.com/a/14339/), 3 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)

    ÒVö

[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LW14&code=0lb2&input=Mgo2)