3 ms·
The source [0] is kind of an incredible copy and paste achievement. Clearly the author doesn't suffer from the "Last Line effect". [1] Still, it was sort of f
by bshimmin 12y ago
The source [0] is kind of an incredible copy and paste achievement. Clearly the author doesn't suffer from the "Last Line effect". [1]
Still, it was sort of fun for a minute or two.
[0]: http://dhmholley.co.uk/civclicker.js http://dhmholley.co.uk/civclicker.js
[1]: https://news.ycombinator.com/item?id=7858612 https://news.ycombinator.com/item?id=7858612
- espadrine 12y ago> * Clearly the author doesn't suffer from the "Last Line effect".* Actually, he failed to put a comma after the `gold = {…}` expression.
- jiggy2011 12y agoThat is nearly 7k lines, what's the chance that it could be re-factored to < 1k with angular/ember?
- dhmholley 12y agoI hope the source isn't too horrible. I was basically a complete javascript novice when I started coding the game. If I were to write it again I'd probably do it very differently, though I still have a lot to learn.
- makmanalp 12y agoThe trick is to reduce parts where you duplicate a lot of code by using generalized functions to abstract things out.
- reitzensteinm 12y agoYou finished it, which is by far the most important thing. Without that, it doesn't matter what the code looks like because you'd have achieved nothing. My first Flash game that I wrote in two weeks had some god awful copy pasted code that made me embarrassed to show anyone. But it made six figures over the years and launched what turned out to be a viable career in game development (I've never had a real job). Code quality is important to work on, but it's just there to help you with the primary goal: shipping something cool. You got there, so fuck the code. Great job.
- Gigablah 12y agoYou got me stuck on your game for two days. I think I might just start coding an incremental game of my own. Cheers!