Hello! I was extremely bored and stumbled accross this website: Hackerrank
It's a website that contains lots of programming challenges of various types.
I signed up and looked at some of the challenges, lots of them are quite over my head since I'm not that skilled or any expert by any means so I thought I would try some of these challenges.
I stumbled across one called "FizzBuzz", the details are here: Click Here
So I program in D myself so I wrote my attempt in D but any feedback in C/C++ is also helpful because I know those as well.
So essentially the goal is to write the described goal in the shortest amount of characters possible which I attempted doing here:
import std.stdio;alias writeln w;void main(){int i;for(i=1;i<=100;i++){if(i%3==0&&i%5!=0)w("Fizz");if(i%3!=0&&i%5==0)w("Buzz");if(i%3==0&&i%5==0)w("FizzBuzz");if(i%3!=0&&i%5!=0)w(i);}}
I'm thinking you can't get it much shorter than this, I managed 184 characters and the site gave me a score of 0.08.
I peeked at the leader boards before I submitted only to see there are highscores of 15.20 which must be an extremely short program! Most of these people are writing in C/C++, I'm just curious if anyone has this mystical knowlege of minimizing the length of programs? This really surprises me a lot, I've never tried anything like this so any information would be appreciated, thanks everyone!