I'm super new to programming and I'm wondering how to tackle one of the most basic problems out there-- the "FizzBuzz" thing. I'm doing this in Groovy.
I have a pretty specific idea of how I want the code to be constructed, but I can't for the life of me figure out how to test something against each value in an array.
What I mean is, say, for each value in list [1,2,3,4], how would I go about checking if each value is even? I know I can select each specific point in the array but that's not what I want-- I'd like to be able to say something like "if n%2=0, label this even."
That's a very basic example, but you probably get the idea. Any help would be greatly appreciated.