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

50%
+0 −0
Challenges Write a Deadfish Interpreter

JavaScript (V8), 78 bytes f=s=>s.map(c=>(_==256||_<0?_=0:0)||c=='i'?_++:c=='d'?_--:c=='s'?_*=_:v+=_+' ') Try it online!

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

Answer
#2: Post edited by user avatar Zakk‭ · 2022-04-27T13:28:03Z (over 2 years ago)
Removed one semicolon.
  • # [JavaScript (V8)](https://v8.dev), 79 bytes
  • ``` javascript
  • f=s=>s.map(c=>(_==256||_<0?_=0:0)||c=='i'?_++:c=='d'?_--:c=='s'?_*=_:v+=_+' ');
  • ```
  • [Try it online!](https://tio.run/##hZDRasMwDEWfm6/wm5xlCWGwMZKp/ZAxTHCWoZHEoXL90uzbM7nNlrKXXQw@uhIXpM8mNGyPNPk8PC9Lh4x7LoZm0hb32iA@PD7Ns3kpDwbLqkzn2SICwcFkWRWxFczzC7LgHZoqZGgyUJDWi3Uje8XNMPXvrFC9JkoERMzs4P5atbEkbn@Ntf5P23xMo5v303BRTI4kUWjLJ7rlKOaW/mrLgeStTpJ1j8t5utNoPblRX81UnWV0Z2THsk52QX4AgW7tFzz15DVAmoobz@LE7N2HDoU/0qCj/yUX@wY)
  • # [JavaScript (V8)](https://v8.dev), 78 bytes
  • ``` javascript
  • f=s=>s.map(c=>(_==256||_<0?_=0:0)||c=='i'?_++:c=='d'?_--:c=='s'?_*=_:v+=_+' ')
  • ```
  • [Try it online!](https://tio.run/##hZDRasMwDEWf66/wm@xlCWGwMZKp/ZAxTHCWoZHEoUrz0uzbM7nNlrKXXQw@uhIXpM9qqtgfaRjT6XlZGmTcc9ZVg/G4Nw7x4fFpnt1LfnCYF7mdZ48IBAeXJEXEWjBNL8iCd@iKKUGXgAa7@NDzqLnqhvadNepXpUVAxMwB7q9VHUvi@tdY6/@0zcc0unk/jRDFFEgShbZ8oluOYq7pr7YcUG@lUusel@s0p96PFHpzNa0@y@jOyY55qXaT/AACzdrPeGhpNADWihvPEsRsw4eZsvFInYn@ly2Xbw)
#1: Initial revision by user avatar Zakk‭ · 2022-04-26T13:07:54Z (over 2 years ago)
# [JavaScript (V8)](https://v8.dev), 79 bytes

``` javascript
f=s=>s.map(c=>(_==256||_<0?_=0:0)||c=='i'?_++:c=='d'?_--:c=='s'?_*=_:v+=_+' ');
```

[Try it online!](https://tio.run/##hZDRasMwDEWfm6/wm5xlCWGwMZKp/ZAxTHCWoZHEoXL90uzbM7nNlrKXXQw@uhIXpM8mNGyPNPk8PC9Lh4x7LoZm0hb32iA@PD7Ns3kpDwbLqkzn2SICwcFkWRWxFczzC7LgHZoqZGgyUJDWi3Uje8XNMPXvrFC9JkoERMzs4P5atbEkbn@Ntf5P23xMo5v303BRTI4kUWjLJ7rlKOaW/mrLgeStTpJ1j8t5utNoPblRX81UnWV0Z2THsk52QX4AgW7tFzz15DVAmoobz@LE7N2HDoU/0qCj/yUX@wY)