Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 424 425 [426] 427 428 ... 796

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

Squeegy

  • Bay Watcher
  • I don't really have any answers for you.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6375 on: September 23, 2014, 08:40:57 pm »

I'm not sure if probability works quite like that.

1. One of the participants in the conversation is known to be female, the other unknown (at the time), and it is not known which the pronoun "he" referred to
2. The female/male ratio of users on bay 12 is less than 1, but more than 0
3. Due to 1 and 2, I had somewhat more than a 50% chance to be correct when saying "she?"
  • Publicly available on my profile!
  • It is exactly 0.07575 repeating.
  • That is technically correct (50% from Skyrunner being female, 7.6% from an unknown user being male or female), except that both of our genders are readily available, so you actually had a 0% chance.
Logged
I think I'm an alright guy. I just wanna live until I gotta die. I know I'm not perfect, but God knows I try.
Kobold Name Generator
⚔Dueling Blades⚔
Fertile Lands
The Emerald Isles

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #6376 on: September 23, 2014, 10:54:45 pm »

Yeah, probably. I have little programming experience so I just assume all of my opinions are rather dumb.

After seeing the work you did on tgstation, I'd say you're rather more competent than most programmers.
If only I could be so grossly competent! :P

Dynamic typing is not to be confused with weak typing--Javascript is both dynamic and weak, Python is dynamic and strong, and C or Java are static and strong. I don't know of a ststic and weak language though.
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 #6377 on: September 24, 2014, 12:24:58 am »

How are you defining weak and strong there? Looking it up tells me nothing...

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #6378 on: September 24, 2014, 12:44:11 am »

Strongly-typed IIRC means that you can't do this
Code: [Select]
i = 1 + "2"
without the compiler/interpreter throwing an error.
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 #6379 on: September 24, 2014, 01:14:41 am »

I thought, as a rule, you couldn't mix strings and constants in a variable?
Logged

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #6380 on: September 24, 2014, 01:22:12 am »

Many languages allow it. They will either convert the int to a string, or the string to an int, and then perform the operation. Java (I think) will return 3, whereas Javascript will return 12. I might have them 'round the wrong way. Squeegy will enlighten me, no doubt.

Other languages are weird, like C, which uses the pointer to the string and adds the int to it, or something. I can't actually remember.

Python, and other languages that I don't recall, are strongly-typed, and will return a type error when given that code.
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 #6381 on: September 24, 2014, 01:35:09 am »

Oh, that's really good to know! :D
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #6382 on: September 24, 2014, 02:57:12 am »

How are you defining weak and strong there? Looking it up tells me nothing...
Well, apparently both are not well defined,  at Wikipedia's Strong & weak typing page. I personally view it as to the degree that implicit conversions between types are allowed.
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

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6383 on: September 24, 2014, 04:18:28 am »

Yeah, C# will convert the int to a string, then add them together. C++ does that as well if you're working with std::string, but not with C style strings.
Logged

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6384 on: September 24, 2014, 06:47:33 am »

Yeah, probably. I have little programming experience so I just assume all of my opinions are rather dumb.

After seeing the work you did on tgstation, I'd say you're rather more competent than most programmers.
Thanks c:
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

Parsely

  • Bay Watcher
    • View Profile
    • My games!
Re: if self.isCoder(): post() #Programming Thread
« Reply #6385 on: September 24, 2014, 10:14:23 am »

Code: [Select]
start

num firstOperand
num secondOperand
num myAnswer

input firstOperand
input secondOperand

multiplyBot()
     myAnswer = firstOperand * secondOperand
     display myAnswer

end
Is this how modules work? It's just pseudo code, so I know there's no "right" way to do it, but is this logic functional? Does it make sense?

Task is to create a module function that has two input parameters.
Not entirely sure if thisd be called a module, module is usually synonymous with library.
A function/method would be a better name. And youd want to define all your variables inside the function, and either get your input inside or pass it as an argument.
Right, according to the book I have modules = functions.

* GUNINANRUNIN burns his book.
Logged

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6386 on: September 24, 2014, 10:51:22 am »

Code: [Select]
start

num firstOperand
num secondOperand
num myAnswer

input firstOperand
input secondOperand

multiplyBot()
     myAnswer = firstOperand * secondOperand
     display myAnswer

end
Is this how modules work? It's just pseudo code, so I know there's no "right" way to do it, but is this logic functional? Does it make sense?

Task is to create a module function that has two input parameters.
Not entirely sure if thisd be called a module, module is usually synonymous with library.
A function/method would be a better name. And youd want to define all your variables inside the function, and either get your input inside or pass it as an argument.
Right, according to the book I have modules = functions.

* GUNINANRUNIN burns his book.
http://interactivepython.org/runestone/static/thinkcspy/index.html
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

Squeegy

  • Bay Watcher
  • I don't really have any answers for you.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6387 on: September 24, 2014, 01:13:03 pm »

Java's typing is admittedly weird. You can't compare two strings together because it will just look at the fact that they are both strings and declare them equal. You have to do "string1.equals(string2)".

Python is my language of choice, though I won't be using it forever since it's a scripting language and not made to be compiled. But it certainly has things that could be done better.
Logged
I think I'm an alright guy. I just wanna live until I gotta die. I know I'm not perfect, but God knows I try.
Kobold Name Generator
⚔Dueling Blades⚔
Fertile Lands
The Emerald Isles

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6388 on: September 24, 2014, 02:27:13 pm »

Python is my language of choice, though I won't be using it forever since it's a scripting language and not made to be compiled.

To be fair, this is becoming less of a problem over time AFAIK.

Squeegy

  • Bay Watcher
  • I don't really have any answers for you.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6389 on: September 24, 2014, 02:30:18 pm »

Until Windows ships with Python in the far off year of Never AD, it will always be a problem because it prevents anyone from using your software unless they download Python. That's what executables are for, delivering the experience to everyone on the OS.
Logged
I think I'm an alright guy. I just wanna live until I gotta die. I know I'm not perfect, but God knows I try.
Kobold Name Generator
⚔Dueling Blades⚔
Fertile Lands
The Emerald Isles
Pages: 1 ... 424 425 [426] 427 428 ... 796