Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 659 660 [661] 662 663 ... 795

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 817699 times)

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #9900 on: August 17, 2016, 01:15:53 pm »

Skyrunner
Sky
Internet
Net
Skynet
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #9901 on: August 17, 2016, 01:21:25 pm »

A couple hours later I figured out what I did. I changed it all into object oriented typescript and now I'm more content.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9902 on: August 18, 2016, 04:53:29 am »

but what did it mean!?

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9903 on: August 18, 2016, 04:59:37 am »

There's a list of lists of lists, the innermost lists probably represent objects. Sort every list of such objects numerically by field 1 of said objects.
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #9904 on: August 18, 2016, 05:52:14 am »

I fixed the code to look like this:

Code: [Select]
//sort by priority
for (let i = 0; i < results.length; i++) {
    results[i].sort(function(d1, d2){ return d2.priority - d1.priority; });
}

It's still not exactly poetry, but at least you can tell it's sorting by priority now.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9905 on: August 18, 2016, 03:16:24 pm »

hardcoding meaningful parts of hybrid array/dictionary data structures as magic number indices in the array part is the worst, especially since describing it is so goddamn clunky (I had "associative array" instead of "dictionary" there but changed it to dictionary because the rest was harder to tell by context)

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9906 on: August 18, 2016, 03:56:36 pm »

hardcoding meaningful parts of hybrid array/dictionary data structures as magic number indices in the array part is the worst, especially since describing it is so goddamn clunky (I had "associative array" instead of "dictionary" there but changed it to dictionary because the rest was harder to tell by context)

yeah in general I hate passing vanilla data around, if a string is an url I put an url object on the signature of the interface, if it's a card seed name I make an enum for it etc, because a type is a type and a string rarely is meaningfully one
Logged

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9907 on: August 18, 2016, 05:20:07 pm »

Hi guys. I finished my dice roller project and decided to tackle a bigger one that ended in great failure just now...A program that could create an entire chapter of space marines via a 'process' of human to implant to chance of failure to space marine. I won't go much more into it because it was just too much.

I just tried a human project (same day) and it caught fire when my IDE eclipse went wacky. I'm starting to learn a few things:

1. I don't know jack about IDE's.
2. I can't seem to be able to read manuals on this online. An YT videos of this are getting really boring.

In short I don't know if I have what it takes to one day make video games and write code. The idea about creating I like but the learning curve is massive and I don't know where to start. I just missed a semester so I have time to just relax and think but I don't know what I should do.

Anyone have this problem? If so, how did you overcome this feeling of smallness. It just feels like the more I learn the more I delve into things the smaller I get and the less I know. I'm also finding that I start things easily (like anyone..) and then burn out when I finish just one or two articles or just can't remember a certain piece of synthax.

((By the way if this isn't the place for these questions I'll just delete it and post somewhere else. Reading the OP 'problems' looked like this could fit here.))
Logged

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9908 on: August 18, 2016, 06:14:05 pm »

eclipse is bad just like that. do you want to make a real program, like something you launch on your desktop, or web pageish?
Logged

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9909 on: August 18, 2016, 07:29:57 pm »

Desktop but more of a school based project thing (not that i'm currently a student). 
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9910 on: August 18, 2016, 07:37:47 pm »

You need to develop incrementally towards more complex programs. Incrementally. Like tiny steps until you get more complex things. e.g. you've got a dice roller. Say you have a loop where you can choose to roll again or quit. You can build a Pokemon type game just around that:

EDIT: Add two health values, player1health, player2health. Each "round" print out each player's health values, and a menu, e.g. "attack", "block", "heal". Use the dice to decide how much health attack loses and heal regains. There you have the basis of building a "Pokemon" style battle system. After that, mod the game so that it presents a series of "battles" vs different named monsters. For a start, don't give them different stats, just different names, and make them weaker in HP than the player.
« Last Edit: August 18, 2016, 07:52:09 pm by Reelya »
Logged

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9911 on: August 18, 2016, 07:40:40 pm »

I do actually like your idea Reelya. I've tried before but I think I know enough to create a wannabe pokemon go game.
Logged

Spehss _

  • Bay Watcher
  • full of stars
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9912 on: August 18, 2016, 07:44:04 pm »

-snip-

Sounds like your primary problem is trying to run before you can walk. That space marine program you're talking about seems far more complicated than a dice rolling program.

I am in a somewhat similar situation to you, so I'll share my advice based on my own experiences.

Biggest advice I'd give is: Start projects small, and build up from there. I'm creating simple programs to test concepts that I may want to later implement in a game. First I get the concept to work. Then I generalize it so it can work when moved to other programs, environments outside of the testing program written specifically for the concept. Then test those concepts later in a separate project, or add new features to old projects, or etc. All of this work ideally could then be used in the future in a larger, more complicated project, and at the same time I'm developing skill at programming and planning programs/algorithms and debugging and etc, and those skills would definitely be useful for later more complicated projects.

edit: Ninja'd by Reelya, who said what I was trying to but in less words.
Logged
Steam ID: Spehss Cat
Turns out you can seriously not notice how deep into this shit you went until you get out.

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9913 on: August 18, 2016, 08:08:03 pm »

There's also another useful concept called "Minimum viable product". e.g. with your space marine thing you list all the features you want, then cross ones out until you have the literal bares bones, at which point if you remove anything else it's no longer the same thing. e.g for Super Mario Bros, the Minimum Viable Product is being able to move to the right and jump. Everything else is additional fluff that's not needed to make the simplest possible game that's still "Mario".

e.g. what's the simplest possible system of listing a bunch of marines and saying what weapon they have? That would be having a single array of ints called "marineWeapon", where 0=no weapon, 1 = boltgun, 2=powersword etc. Then you just have a for loop that goes through the array and prints out "Marine X has weapon Y", with hard-coded if-statements or a switch to print out the weapon types.

Stage two would be to convert the weapon types from hard-coded if-statements, to a table of weapon names.

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #9914 on: August 18, 2016, 08:09:38 pm »

-snip-

Sounds like your primary problem is trying to run before you can walk. That space marine program you're talking about seems far more complicated than a dice rolling program.

I am in a somewhat similar situation to you, so I'll share my advice based on my own experiences.

Biggest advice I'd give is: Start projects small, and build up from there. I'm creating simple programs to test concepts that I may want to later implement in a game. First I get the concept to work. Then I generalize it so it can work when moved to other programs, environments outside of the testing program written specifically for the concept. Then test those concepts later in a separate project, or add new features to old projects, or etc. All of this work ideally could then be used in the future in a larger, more complicated project, and at the same time I'm developing skill at programming and planning programs/algorithms and debugging and etc, and those skills would definitely be useful for later more complicated projects.

edit: Ninja'd by Reelya, who said what I was trying to but in less words.

Possibly. So of all the things you know (I assume you know a lot and possibly have a C.S degree) do you remember it all as soon as you need it during planning or coding? I had to go back and look at some general code for how to get arrays and array lists to work for objects. I remember it existed but just not the actual synthax which feels embarrassing but I don't know what kind of 'level' i'm suppose to be on. Or what I should Aim for hence why I aim so high.

Anyways i'm going to go get sucked into some programming before the hour gets too late and I procrastinate again. Thank you all for your advice :)

EDIT: Ninja'd. The program was suppose to simulate how many people could successfully be turned into space marines to make a full chapter (which is 1000) people. Both 'human' and space marine would have to have been saved by two different arraylists (I think these would be better for memory than anything else I know). So say 1000 marines are made and then 10,000 people died failing to become space marines. There was also the fact that both human and space marine were objects with names, backgrounds, and stats each. I'll stop their. Suffice to say that my new projects will build up to it at another date. For now, make generic humans and put them into an array called a house.

Then have Pikachu fight a water pokemon with 1-4 attacks and 10 hp each. Then maybe something else. TBH I can see why the chapter master game that floats around is unfinished theirs just too many variables to keep track of!

Also I like the minium viable product idea. If it's one thing I (re?)learned today it's that building up is critical in programming.
« Last Edit: August 18, 2016, 08:14:30 pm by 3man75 »
Logged
Pages: 1 ... 659 660 [661] 662 663 ... 795