Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 578 579 [580] 581 582 ... 796

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

3man75

  • Bay Watcher
  • I will fire this rocket
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8685 on: December 14, 2015, 08:23:46 am »

Thanks for your help. But I remember doing something similar that caused the loop to go bad when I tried to use x(woudn't identify or needed a pointer), how would I fix that?

Right now it seems like when I pass an array it either works or dosen't want to work (an thinking like that is never good in the tech. world). Also I know it's not 'junk' but it's what we called it in class when our programs accessed memory/files we didn't need.
Logged

Reelya

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8686 on: December 14, 2015, 08:39:14 am »

Thanks for your help. But I remember doing something similar that caused the loop to go bad when I tried to use x(woudn't identify or needed a pointer), how would I fix that?

Right now it seems like when I pass an array it either works or dosen't want to work (an thinking like that is never good in the tech. world). Also I know it's not 'junk' but it's what we called it in class when our programs accessed memory/files we didn't need.

Try adding more print statements to check the values of variables during the run. e.g. each loop print x and book[ x ] with this:

cout << " x = " << x << endl;
cout << "book[" << x << "] = " << book[ x ] << endl;

You should do this often if you're having problems with basic stuff. You should be adding print statements all over the place to check values before thinking of getting help. All professional programmers use print statements to see what variables are doing. Everyone does, because it's so effective at alerting you to errors.

Make sure that variables have the values that you expect. You can also add a print statement to detect errors which should not occur, e.g. each time you access an array you can check the value that's being used as the index:

if(x < 0 || x >= size)
{
    cout << "I dun passed the wrong value" << endl;
}

for example, a 10-element array goes from 0 to 9, so it would be an error to pass it an x value of <= -1 or >= 10.
« Last Edit: December 14, 2015, 08:56:15 am by Reelya »
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #8687 on: December 14, 2015, 09:00:11 am »

Heck, you could even argue that debuggers are simply infinitely more detailed and easy-to-use print statements...
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

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #8688 on: December 14, 2015, 08:31:50 pm »

Heck, you could even argue that debuggers are simply infinitely more detailed and easy-to-use print statements...
raise IdiotProgrammerError

...

[spoiler]This will be hidden if BBCode is enabled[/spoiler]
Code: [Select]
[spoiler]yeah but you could just put it in a [code] block which is easier[/spoiler]
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8689 on: December 14, 2015, 08:33:23 pm »

I think I borked Java.

I can't compile anything, Netbeans freezes up, and I can't even LAUNCH Eclipse for some probably-different reason.

Helllp meee.
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8690 on: December 14, 2015, 10:54:47 pm »

I think I borked Java.

I can't compile anything, Netbeans freezes up, and I can't even LAUNCH Eclipse for some probably-different reason.

Helllp meee.
More info is needed. Are you getting any errors with netbeans? How about when you try to launch eclipse, what error are you getting there? Have you tried repointing netbeans/etc at your Java JDK? Have you checked to see if you can update to a later version of anything? Did you do anything specific before it froze? Have you tried restarting the computer? Are you running any other programs at the time that you were trying to open stuff?
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8691 on: December 14, 2015, 11:02:51 pm »

It was Malwarebytes Anti-Exploit for some reason.

I still don't know WHAT'S with Eclipse but I don't really care all that much.
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

Cryxis, Prince of Doom

  • Bay Watcher
  • Achievment *Fail freshman year uni*
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8692 on: December 14, 2015, 11:46:05 pm »

Guess who gets to learn Robotc for their engineering class.

.....

It's me
Logged
Fueled by caffeine, nicotine, and a surprisingly low will to live.
Cryxis makes the best typos.

TheBiggerFish

  • Bay Watcher
  • Somewhere around here.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8693 on: December 14, 2015, 11:46:52 pm »

Huh.
Good luck, there.

You'll need it.
Logged
Sigtext

It has been determined that Trump is an average unladen swallow travelling northbound at his maximum sustainable speed of -3 Obama-cubits per second in the middle of a class 3 hurricane.

Cryxis, Prince of Doom

  • Bay Watcher
  • Achievment *Fail freshman year uni*
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8694 on: December 14, 2015, 11:48:40 pm »

Thank you
I'll probably come here if I get confused
Logged
Fueled by caffeine, nicotine, and a surprisingly low will to live.
Cryxis makes the best typos.

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8695 on: December 14, 2015, 11:52:54 pm »

In what's possibly a futile choice of actions, I'm currently smashing F# and WPF together and hoping something good gets produced. Both are things I'd like to know more about, both personally and as far as the local job market is concerned.
Logged

jaked122

  • Bay Watcher
  • [PREFSTRING:Lurker tendancies]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8696 on: December 15, 2015, 12:56:20 am »

Ehh, I remember robotC, did it at a summer camp a few years back.


Don't remember any of it now, but it wasn't all that different from normal C. Just a little bit more restrictive.


Also coroutines. Those existed in it. They were alright.

BlindKitty

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8697 on: December 15, 2015, 08:12:07 am »

Try adding more print statements to check the values of variables during the run. e.g. each loop print x and book[ x ] with this: --snip--

You can also try using a language that actually gives you decent error messages and/or decent debugger with Watch option (which just keeps showing you the value of a variable without printing it all the time). :P (That is, of course, unless you need C/C++ for some other reason).
Logged
My little roguelike craft-centered game thread. Check it out.

GENERATION 10: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #8698 on: December 15, 2015, 09:17:47 am »

Try adding more print statements to check the values of variables during the run. e.g. each loop print x and book[ x ] with this: --snip--

You can also try using a language that actually gives you decent error messages and/or decent debugger with Watch option (which just keeps showing you the value of a variable without printing it all the time). :P (That is, of course, unless you need C/C++ for some other reason).

C++ also happens to have the best debugger ever, aka Visual Studio!
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

itisnotlogical

  • Bay Watcher
  • might be dat boi
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #8699 on: December 15, 2015, 10:25:24 am »

I downloaded Visual Studio a few days ago. It's definitely better than Code::Blocks or Geany, and it's the only IDE I've seen with a GUI programming system that does not make me want to commit seppuku.

Well, I guess NetBeans had something similar, but my problems with NetBeans stem from Java and Swing. Particularly the "look and feel", which has no purpose except to make your programs eye-gougingly ugly unless you set it to use the system default look-and-feel.
« Last Edit: December 15, 2015, 10:27:40 am by itisnotlogical »
Logged
This game is Curtain Fire Shooting Game.
Girls do their best now and are preparing. Please watch warmly until it is ready.
Pages: 1 ... 578 579 [580] 581 582 ... 796