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

66%
+2 −0
Challenges Reduce over the range [1..n]

Japt, 4 bytes Takes the operator as a string but would also work without modification using a function by assigning it to variable V. That can be done in the header by leaving a blank line and the...

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

Answer
#3: Post edited by user avatar Shaggy‭ · 2021-08-10T15:50:04Z (over 3 years ago)
  • # [Japt](https://github.com/ETHproductions/japt), 4 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • õ rV
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=9SByVg&input=MTAKIl4i)
  • õ rV :Implicit input of integer U and operator V, as string
  • õ :Range [1,U]
  • rV :Reduce by V
  • # [Japt](https://github.com/ETHproductions/japt), 4 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • Takes the operator as a string but would also work without modification using a function by assigning it to variable `V`. That can be done in the header by leaving a blank line and then entering a function in the form `XY{X[op]Y}`, where `[op]` is the operator or method.
  • õ rV
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=9SByVg&input=MTAKIl4i)
  • õ rV :Implicit input of integer U and operator V, as string
  • õ :Range [1,U]
  • rV :Reduce by V
#2: Post edited by user avatar Shaggy‭ · 2021-08-10T15:20:41Z (over 3 years ago)
  • # [Japt](https://github.com/ETHproductions/japt), 4 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • õ rV
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=9SByVg&input=MTAKIl4i)
  • # [Japt](https://github.com/ETHproductions/japt), 4 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
  • õ rV
  • [Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=9SByVg&input=MTAKIl4i)
  • õ rV :Implicit input of integer U and operator V, as string
  • õ :Range [1,U]
  • rV :Reduce by V
#1: Initial revision by user avatar Shaggy‭ · 2021-08-10T15:19:18Z (over 3 years ago)
# [Japt](https://github.com/ETHproductions/japt), 4 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)

    õ rV

[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&code=9SByVg&input=MTAKIl4i)