u/escape - 21 Archived Voat Posts in v/programming
u/escape
  • home
  • search

u/escape

0 posts · 21 comments · 21 total

Active in: v/programming (21)

  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››
Comment on: Dumb Beginner HTML Question

Are you sure you're qualified to take part in this subreddit?

https://en.wikipedia.org/wiki/Declarative_programming#Domain-specific_languages

0 25 Aug 2015 05:57 u/escape in v/programming
Comment on: Dumb Beginner HTML Question

Wait what? You don't think HTML is part of programming? It isn't a compiled language, but that's an oddly esoteric definition that seems to be used by pedants when talking about programming. The act of writing HTML is literally called "programming" and HTML is the first language most people who learn programming learn. It's obviously part of programming.

Are you autistic?

0 25 Aug 2015 05:51 u/escape in v/programming
Comment on: Dumb Beginner HTML Question

No I'm just curious why you're so uptight about someone including HTML in programming, despite it obviously being a subset of programming.

0 25 Aug 2015 05:50 u/escape in v/programming
Comment on: Dumb Beginner HTML Question

It requires a semi-colon. >

0 25 Aug 2015 05:44 u/escape in v/programming
Comment on: Dumb Beginner HTML Question

Dude just ignore him. He's clearly trolling at this point.

0 25 Aug 2015 05:43 u/escape in v/programming
Comment on: Dumb Beginner HTML Question

Which rule is this breaking, hmm?

0 25 Aug 2015 05:42 u/escape in v/programming
Comment on: Dumb Beginner HTML Question

So, you'd say the same of CSS

Absolutely. CSS may as well be considered a core part of HTML as it isn't used for anything else.

XML?

Sure. It's dated now and not worth learning but it's all part of the bag.

Browsers are very permissive of error-filled HTML, in general your interpreter/compiler isn't going to be anywhere as permissive of error-filled code

Which is the entire point of learning HTML first. It's more user-friendly and isn't as daunting to learn.

The relation to programming is only as strong as your view of programming being majority web-based.

The majority of programming isn't web-based. However web programming is a very important part of programming.

I'm not sure why you're so insistent that HTML isn't part of programming and why you're still arguing about this.

0 25 Aug 2015 05:41 u/escape in v/programming
Comment on: Dumb Beginner HTML Question

Don't listen to him. HTML is acceptable to post here since it's often most people's starting point in learning HTML. You're welcome to post about it here.

4 25 Aug 2015 04:55 u/escape in v/programming
Comment on: Dumb Beginner HTML Question

Do you type out tags in sequence like open A, open/close IMG, close A? Or do you do open A, close A, move cursor back, open/close IMG?

I do the latter. So like this:

// 1

<a href="#"></a>

// 2

<a href="#">
</a>

// 3

<a href="#">
    <img src="#">
</a>

I find that it helps me keep track of my elements and layout better. Also depending on what editor you're using, it can close the tags for you as you type. Sublime Text 3 does this. It's really handy.

1 25 Aug 2015 04:09 u/escape in v/programming
Comment on: Dumb Beginner HTML Question

HTML is often associated with programming languages. It's a markup language but it's often the first thing people learn when learning programming.

0 25 Aug 2015 03:59 u/escape in v/programming
Comment on: Dumb Beginner HTML Question
<a href="https://pbs.twimg.com/media/CLBO4fLXAAA1jTo.jpg"
    <img src="https://sickr.files.wordpress.com/2013/05/donkey_kong_bananas.jpg?w=604&h=604">
</a>
<a href="https://pbs.twimg.com/media/CLBO4fLXAAA1jTo.jpg">
    <img src="https://sickr.files.wordpress.com/2013/05/donkey_kong_bananas.jpg?w=604&h=604">
</a>

See what is different.

Edit: Also since you're using HTML5, you don't need self closing tags. Use <img src="..."> instead of <img src="..." />

2 25 Aug 2015 03:58 u/escape in v/programming
Comment on: I hope one day I'll live in a country where I have freedom to write any code I like without fearing.

Yep code is right here: https://github.com/shadowsocks/shadowsocks-iOS/tree/master

1 23 Aug 2015 00:46 u/escape in v/programming
Comment on: If someone with 5-10 years of experience in something, be it Java or a specific database, is called 'Senior'....

It's also why my dad, a Sysadmin with 30 years experience can't find a job. Because he has 30 years experience and not 5.

2 30 Jul 2015 21:22 u/escape in v/programming
Comment on: If someone with 5-10 years of experience in something, be it Java or a specific database, is called 'Senior'....

I wasn't answering the original question. I was giving you information that affects the question.

2 30 Jul 2015 21:04 u/escape in v/programming
Comment on: If someone with 5-10 years of experience in something, be it Java or a specific database, is called 'Senior'....

In industries that involve programming, having more older experience is far often less valuable than having up to date experience. Someone with 5 years of experience could be just as valuable as someone with 20 years experience. Especially if the latter hasn't kept up with new tech.

3 30 Jul 2015 20:42 u/escape in v/programming
Comment on: glot.io open source pastebin where you can run code in browser (20+ languages)

Why would it run javascript server side? What sense does that make?

0 27 Jul 2015 03:38 u/escape in v/programming
Comment on: glot.io open source pastebin where you can run code in browser (20+ languages)

Weird. It wouldn't let me run alert() in javascript. Kept giving me an error.

0 27 Jul 2015 00:45 u/escape in v/programming
Comment on: Learn Ruby by playing a video game.

I tried to login using Facebook and it broke the game. Every time I tried to select a hero it would say "hands off! not yo warrior!". If I created a new one, it would log me out. No way to save progress it seems.

0 11 Jul 2015 20:19 u/escape in v/programming
Comment on: Are idle games easy to code?

I haven't really spent much time dealing with large numbers in my projects. The typical way I've seen is go up to 999 then convert to 1.00K, then 1.00M, 1.00B, 1.00T, 1.00Qa, 1.00Qi, 1.00Sx, 1.00Sp, 1.00O, 1.00N, and so on. That way the most digits you display would be five (999.99K). You can use a simple if statement to determine if the value should be displayed as K, M, etc. The back end value would remain the same. 980520001 would simply display as 980.52M for instance.

1 01 Jul 2015 20:55 u/escape in v/programming
Comment on: Are idle games easy to code?

Oh yeah sure feel free to use it. As far as being outside of the scope of a beginner probably not. If you understand functions, arguments, variables, etc. you should be fine. If you have questions I can try to answer them as well. I'll subscribe to that sub too. I love idle games and I want to build a really engaging one but I'm limited on time for the most part.

1 29 Jun 2015 06:47 u/escape in v/programming
Comment on: Are idle games easy to code?

Yeah. Well, I've only poked around in it a bit. If you know how to write functional JavaScript it's easy. The hard part is balance and coming up with a fun formula. From my limited experience with them, I know you need:

  • The click function
    This is the first and only available action the player can take, initially (in most cases). Click to collect some kind of resource. Write a function like this:

    var points = 0; // Track total points here
    var bonus = 0; // If you use modifiers for higher points per click, use this
    var theClick = function(n) {
        if ( n > 1 ) {
            points = points + ( n * (1 + bonus));
        } else {
            points = points + (1 + bonus);
        }
    }  
    

    Then just apply that function to a button in your interface. The n argument is explained below in the repeated function.

  • Resource(s)
    In my example above, points are your primary resource. You'll earn it from your theClick() function. You can get creative and come up with multiple resources (with multiple functions) to add more depth to your game. This is good if you want to add a rarer resource later in the game.

  • The repeating function
    Next you need to write a function that repeats every X seconds. This is used if you have "clickers" in your game. Any kind of upgrade that does the clicking for you. In the above example, I've included an argument to your function. Use this argument with the number of clickers the player currently has. Example:

     var clickers = 3;
     setInterval(
         theClick(clickers), 1000;
     )  
    

    This will fire your function every 1000ms (1 second). It passes the number of clickers as the argument, which multiplies the effect of the function. In the above example, it will add 3 to your points every 1 second.

  • Upgrades
    Upgrades add depth and interest to your game. This could be something like a percentage bonus to clicks, or doubling the effectiveness of your clickers.

Those are the core building blocks of any idle clicker game. The funnest games have many more layers to them, adding hundreds of upgrades, new resource types, animations, etc. It's a good exercise for someone who is an intermediate at JavaScript coding to build one of these kinds of games.

Edit: Fixed the click function.

7 29 Jun 2015 06:29 u/escape in v/programming
  • ‹‹‹
  • ‹‹
  • ‹
  • 1
  • ›
  • ››
  • ›››

archive has 9,592 posts and 65,719 comments. source code.