LOADING: An error occurred. Update Chrome, try Firefox, or visit this post for more details.

⚠️Reddit changed how removals work, which breaks Reveddit's website. Install the extension to track removed content:Add to chromeAdd to firefoxWhat changed?
✖︎
about reveddit
⚙F.A.Q.add-ons
r/
status
copy sharelink
[+] show filters
102
SOLUTION MEGATHREAD-🎄- 2022 Day 2 Solutions -🎄-(self.adventofcode)
submitted 3 years, 1 month ago* (edited 4 days, 4 hours after) by daggerdragon to /r/adventofcode (134.8k)
1501 commentsredditother-discussionssubreddit-indexmessage modsop-focus

NEW AND NOTEWORTHY

  • All of our rules, FAQs, resources, etc. are in our [community wiki](/r/adve...

... view full text

since 3 years, 1 month ago
1 of 1

Tip Reveddit Real-Time can notify you when your content is removed.

your account history
(check your username's removed content. why?)
Tip Check if your account has any removed comments.
view my removed comments
you are viewing a single comment's thread.
view all comments
[–][deleted]3 points3 years, 1 month ago

UXN Forth

variable score
0 constant rock
1 constant paper
2 constant scissors

: points-of 1+ ;
: victim ( u1 -- u2 ) 1- dup 0< if drop 2 exit then ;
: foil ( u1 -- u2 ) 1+ 3 mod ; 
: game-score ( u1 u2 -- u3 ) 
  2dup swap foil = if 2drop 6 exit then
  2dup swap victim = if 2drop 0 exit then
  2drop 3 ;
: add-score ( u1 u2 -- ) dup>r game-score r> points-of + score +! ;

\ data is code
: A rock ;
: B paper ;
: C scissors ;
: X rock add-score ;
: Y paper add-score ;
: Z scissors add-score ;
include input.txt 
score @ u. cr \ part 1

0 score !
: X dup victim add-score ;
: Y dup add-score ;
: Z dup foil add-score ;
include input.txt
score @ u. cr \ part 2
bye

A fun one, because the input is structured such that we can define forth words for each letter. No string parsing needed outside of the forth interpreter.

permalinkas-of
r/revedditremoved.substack.com
🚨 NEWS 🚨
✖︎

Important: Reddit Changed How Removals Work

A recent Reddit update makes mod-removed content disappear from profile pages, which breaks Reveddit's website.

Install the browser extension to receive removal alerts.

Add to chromeAdd to firefox

What changed?

r/revedditremoved.substack.com