Skip to content

Instantly share code, notes, and snippets.

View nicuveo's full-sized avatar
🏳️‍⚧️

Antoine Leblanc nicuveo

🏳️‍⚧️
View GitHub Profile
@nicuveo
nicuveo / roll.bf
Created February 25, 2025 16:00
Brainfuck Roll
// this file is not valid Brainfuck as Brainfuck has no notion of comments
// and all symbols within comments would be interpreted as commands
// but let's pretend those are comments for the sake of this being readable
// given a stack of values [....,s06,s05,s04,s03,s02,s01,s00,d,n]
// this function rolls the stack `n` times at a depth `d`
// for instance:
// input: [5,4,3, 2,1,0, 3,2]
// output: [5,4,3, 1,0,2]