Firstly, it doesn't really make sense to push 100, run a ( block, and then do n 1 + when you could instead just use ɾ to get the range 1, 2, ..., 100: 100 ɾ (. Now, you are looping from 1 to 100, which makes a lot more sense. In fact, in the comments, I mentioned how by duplicating the computed currentvalue thrice, you could just pop off the stack instead of using ←currentvalue, but this way, n will be the correct value (or you could save it in the for loop using (x|...).
Also, as pointed out by exedraj/lyxal (the creator of this language), it is better to use a map lambda as this creates the list and lets you manipulate it later, rather than just outputting within the for loop.
Thus, we can do this:
100 ɾ ƛ n 15 % 0 = [ `FizzBuzz` | n 3 % 0 = [ `Fizz` | n 5 % 0 = [ `Buzz` | n ]]] ; ⁋
(Also, just stylistically, I like to put the %3 first and %5 second because it's called FizzBuzz after all, not BuzzFizz. Though this doesn't matter. Also, you should close your structures if you want it to be more idiomatic and readable rather than golfed.)
Then, IMO it actually makes more sense to nest the %3 and %5 checks within each other rather than using %15 - this makes it clearer that FizzBuzz is output when it is divisible by both (which is equivalent to being divisible by 15 (or generally the LCM) here but this is more explicit).
Also, there's a built-in for checking divisibility. I don't think % 0 = is actually any better. It's probably more readable for someone who doesn't know what Vyxal's built-ins are, but idiomatically, you should be using Ḋ instead.
100 ɾ ƛ n 3 Ḋ [ n 5 Ḋ [ `FizzBuzz` | `Fizz` ] | n 5 Ḋ [ `Buzz` | n ] ] ; ⁋
(You could store n 5 Ḋ into a variable but there's honestly no point because those two expressions can't both be run, so you wouldn't actually be introducing any optimizations.)
Finally, my personal preference for the FizzBuzz problem has always been to just build a string by combining the relevant components, and if that string is empty, returning n itself. Firstly, this makes it clearer what's going on (to me), where basically you say "if it's divisible by 3, output Fizz, if it's divisible by 5, output Buzz", and thus if it's divisible by both, both Fizz and Buzz are output. Secondly, this makes it more extendable.
100 ɾ ƛ ⟨3 | 5⟩ Ḋ ⟨`Fizz` | `Buzz`⟩ * ∑ n ∨ ; ⁋
Here, we take n, check divisibility by 3 and 5 in parallel (₍₃₅ is shorter but that isn't as clear), and then replicate by ["Fizz", "Buzz"] using * and then sum the strings together. Finally, we take logical or with n in case of empty string (note that ∨ is logical OR, not a lowercase letter v). Finally, we output each line.
It's mostly up to preference which one to use, and Vyxal doesn't have an established set of best practices anyway, but the main takeaway is to use the proper looping values; if you have to alter your loop value and save to a variable, you probably should've done that outside the loop so you can just use n and have it be the proper correct value.
The other reason I like the last one is this:
2 3 5 W →factors `Yeet` `Fizz` `Buzz` W →strings 100 ɾ ƛ n ←factors Ḋ ←strings * ∑ n ∨ ; ⁋
Try It Online!
It's easy to extend.
(⁋ means "join on newline"; you can also use ¶ j or `\n` j for more clarity. Or, of course, just use the j flag.)
class Foo { public void bar() {. without any}}at the end. \$\endgroup\$[block. \$\endgroup\$,outside the if statement if you close it. \$\endgroup\$