It's declaring an array with the name main and a size of -1u. -1u is unsigned -1, or 4294967295. It's implicitly typed int, which means the array is 16 GB large on most architectures. The first element is set to 1, all the others are set to 0. All of that is dumped in the binary, so the file will be 16 GB+ and the compiler won't be very responsive. There's no main function, but because the symbol is called "main" the linker will accept it. The executable will be created but won't work.
ITT: We critique each others fizzbuzzes
I'd rather take a bloated program than a slow program.
So I was in the right staying sceptical of actually attempting to compile it.
seq 100|sed 5~5cBuzz|sed 3~3s/[^B]*/Fizz/
...
GNU isn't perfect but it sure is better than traditional inefficient arbitrarily-limited Unix.
while($counter++,$num++ -lt 100){ $mod3 = $num % 3 $mod5 = $num % 5 if($mod3 -eq 0 -and $mod5 -eq 0){ Write-Output FizzBuzz }elseif($mod5 -eq 0){ Write-Output Buzz }elseif($mod3 -eq 0){ Write-Output Fizz }else{ Write-Output $num }}
sauce? are there n00dez?
Care to explain this bit? It really confuses me.
The suffix "u" makes the compiler read the integer as an unsigned integer. Because it is almost guaranteed that the computer uses two-complement to represent integers, signed -1 is equivalent to the maximum permitted unsigned integer, i.e. 1111 1111 1111 1111...
So, he's creating an array of UINT_MAX which contains the number 1 everywhere.