Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 427 428 [429] 430 431 ... 796

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

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6420 on: October 01, 2014, 03:54:04 pm »

Well I think it's pretty safe for me to assume its harder to pick up c++ from python than the other way around.

So. It's pretty darn simple.

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6421 on: October 01, 2014, 04:17:38 pm »

Python is very simple. If you've done no coding at all it's really easy, so being experienced should make it even easier.
Logged

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #6422 on: October 01, 2014, 11:54:30 pm »

Python is ludicrously easy. Hello World is just "print ('Hello, World')".
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.

Sheb

  • Bay Watcher
  • You Are An Avatar
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6423 on: October 02, 2014, 05:40:19 am »

Python is ludicrously easy. Hello World is just "print ('Hello, World')".

What happened to the comma? Weird data handling? :p
Logged

Quote from: Paul-Henry Spaak
Europe consists only of small countries, some of which know it and some of which don’t yet.

EnigmaticHat

  • Bay Watcher
  • I vibrate, I die, I vibrate again
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6424 on: October 03, 2014, 01:33:21 am »

No, it would still be there in the output.

...I'm making a guess that that the :P did not indicate sarcasm.
Logged
"T-take this non-euclidean geometry, h-humanity-baka. I m-made it, but not because I l-li-l-like you or anything! I just felt s-sorry for you, b-baka."
You misspelled seance.  Are possessing Draignean?  Are you actually a ghost in the shell? You have to tell us if you are, that's the rule

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #6425 on: October 03, 2014, 06:55:06 pm »

Sorry. Sometimes, I push the comma button when I don't need too.

Python is ludicrously easy. Hello, World is just "print ('Hello, World')".
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.

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6426 on: October 04, 2014, 12:52:26 am »

Spoiler: Practicing from a Book (click to show/hide)
Logged

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6427 on: October 04, 2014, 12:59:49 am »

i think they want you to use for loops

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6428 on: October 04, 2014, 01:07:41 am »

i think they want you to use for loops
I think I suck at this.

E:
Spoiler (click to show/hide)
« Last Edit: October 04, 2014, 01:24:22 am by GUNINANRUNIN »
Logged

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6429 on: October 04, 2014, 01:57:13 am »

can you array out the discounts?

Excuse the C code but.
Code: [Select]
float discount_week[6];

for(float i = 1; i <= 6; i++)
{
   discount_week[i-1] = ( ( i - 1 ) * 0.12 ) )
}

That would initialize the entire week for you in an array where 0 is the first week and 5 is the final week.

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #6430 on: October 04, 2014, 02:02:37 am »

Spoiler (click to show/hide)
I know the purpose of this thread is to help and encourage, but that should win a medal. For something.
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.

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6431 on: October 04, 2014, 02:04:26 am »

Spoiler (click to show/hide)
I know the purpose of this thread is to help and encourage, but that should win a medal. For something.
>_>

can you array out the discounts?

Excuse the C code but.
Code: [Select]
float discount_week[6];

for(float i = 1; i <= 6; i++)
{
   discount_week[i-1] = ( ( i - 1 ) * 0.12 ) )
}

That would initialize the entire week for you in an array where 0 is the first week and 5 is the final week.
Thanks Puffer, only thought to use an array after the fact, which I sort of just learned this morning what those were.
Logged

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #6432 on: October 04, 2014, 02:06:03 am »

Don't worry, I made abominations far worse than that when I was learning how to code.

...

And the stuff I write now is far from professional, so yeah.
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.

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6433 on: October 04, 2014, 02:08:35 am »

But disregarding innefficiency, it does make sense right?

if yes then
     WIN
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #6434 on: October 04, 2014, 02:09:04 am »

Spoiler (click to show/hide)
I know the purpose of this thread is to help and encourage, but that should win a medal. For something.
That's being mean.

Gunin basically implemented a manual hardcoded key-value lookup table or an array using if/elses, which is a pretty logical way to handle things if you don't know that dicts exist.

But disregarding innefficiency, it does make sense right?

if yes then
     WIN

yeah, it's fairly efficient in terms of speed (only O(N)!) and inefficient in terms of coder time (only O(N)!), but the logic itself is sound :P
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
Pages: 1 ... 427 428 [429] 430 431 ... 796