Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 205 206 [207] 208 209 ... 796

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

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3090 on: October 15, 2012, 10:06:28 am »

 o(log(n!)) == o(n*log(n))  if I recall correctly so you're both right  :P
Logged

da_nang

  • Bay Watcher
  • Argonian Overlord
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3091 on: October 15, 2012, 10:18:54 am »

o(log(n!)) == o(n*log(n))  if I recall correctly so you're both right  :P
Not really.
O(n*log(n)) = O(log(nn)) and n! < nn for n > 1 thus O(log(n!)) < O(n*log(n)).
But I get what you mean. :P
Logged
"Deliver yesterday, code today, think tomorrow."
Ceterum censeo Unionem Europaeam esse delendam.
Future supplanter of humanity.

LoSboccacc

  • Bay Watcher
  • Σὺν Ἀθηνᾷ καὶ χεῖρα κίνει
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3092 on: October 15, 2012, 10:58:32 am »

sure, but at the same time o(n/2 * log(n/2)) <  O(log(n!)) < O(n*log(n))

and when n is big enough...

it's all weird because it's all about the angle you have when you reach inf, not the value (and my classes were far, far less hard than your exercise so I may get something wrong. it was, like, ten years ago :P )
« Last Edit: October 15, 2012, 11:00:59 am by LoSboccacc »
Logged

da_nang

  • Bay Watcher
  • Argonian Overlord
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3093 on: October 15, 2012, 11:17:37 am »

sure, but at the same time o(n/2 * log(n/2)) <  O(log(n!)) < O(n*log(n))

and when n is big enough...

it's all weird because it's all about the angle you have when you reach inf, not the value (and my classes were far, far less hard than your exercise so I may get something wrong. it was, like, ten years ago :P )
Huh. I suppose it must be true, since the quotient limit n*log(n)/log(n!) is a non-zero constant. And then there's Stirling's approximation. The more you know! :P

Add some Google-fu.
« Last Edit: October 15, 2012, 11:21:18 am by da_nang »
Logged
"Deliver yesterday, code today, think tomorrow."
Ceterum censeo Unionem Europaeam esse delendam.
Future supplanter of humanity.

Valid_Dark

  • Bay Watcher
  • If you wont let me Dream, I wont let you sleep.
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3094 on: October 15, 2012, 11:12:17 pm »

yay math!
Logged
There are 10 types of people in this world. Those that understand binary and those that don't


Quote
My milkshake brings all the criminals to justice.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3095 on: October 16, 2012, 12:02:50 am »

yay math!

Math is a somewhat important part of programming :P

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3096 on: October 16, 2012, 11:12:33 pm »

Learning C++ by reading Liberal Crime Squad's source and looking up everything I don't understand YEAH!

(Of course, once that becomes unsustainable/boring I'll probably just start solving math programs by programming to solve said math programs)
« Last Edit: October 16, 2012, 11:14:55 pm by Putnam »
Logged

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3097 on: October 16, 2012, 11:43:54 pm »

Learning C++ by reading Liberal Crime Squad's source and looking up everything I don't understand YEAH!

(Of course, once that becomes unsustainable/boring I'll probably just start solving math programs by programming to solve said math programs)

Yeah good luck with that.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3098 on: October 16, 2012, 11:46:45 pm »

Learning C++ by reading Liberal Crime Squad's source and looking up everything I don't understand YEAH!

(Of course, once that becomes unsustainable/boring I'll probably just start solving math programs by programming to solve said math programs)

Yeah good luck with that.

I've been thank you :P

(The googling has been far more than the reading, but my meager programming experience combined with forte in liberal crime squad is surprisingly enough to understand what's going on in there)

(Besides that, the comments are marvelous :P)
« Last Edit: October 16, 2012, 11:55:12 pm by Putnam »
Logged

dreadmullet

  • Bay Watcher
  • Inadequate Comedian
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3099 on: October 17, 2012, 01:13:48 am »

Learning C++ by reading Liberal Crime Squad's source and lo-

Are you serious? The only way you could learn from LCS's source is by recognizing that that's how NOT to code. I highly suspect Toady One picked up most of his programming habits from some C textbook in 1990; horribly short variable and function names, large influence from C (not much use of OOP and lots of global variables). And the game is just barely held together with duct tape. Although I am basing all of this on the version on SourceForge.

Actually, I am exaggerating a little bit. Of course you can learn some useful stuff from LCS's source. I got a grasp on PDCurses by looking at the source. And I'm sure that if you're a complete newbie to C++ you could learn some basics. Just don't go picking up any coding habits.  :P
Logged

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3100 on: October 17, 2012, 01:55:03 am »

C-style code in C++ = Don't learn D:
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

Mego

  • Bay Watcher
  • [PREFSTRING:MADNESS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3101 on: October 17, 2012, 08:16:55 am »

Short variable names make code harder to read, but Hungarian notation means that your coworkers hate you and do mean things to you. You don't want that. Don't use Hungarian notation.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #3102 on: October 17, 2012, 08:27:24 am »

Welp, does Visual Studio 2010 not support enum class? D: The docs say it does, but it's not working. I get a bunch of rror C3381: '<unnamed-tag> and error C2059: syntax error : 'public' .

Code: [Select]
using namespace std;

public enum class ERROR {NONE = 0, TEST = -1};
public enum class ASCII {AT = 64};

The docs here say it supports enum class.
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 #3103 on: October 17, 2012, 08:46:44 am »

Learning C++ by reading Liberal Crime Squad's source and lo-

Are you serious? The only way you could learn from LCS's source is by recognizing that that's how NOT to code. I highly suspect Toady One picked up most of his programming habits from some C textbook in 1990; horribly short variable and function names, large influence from C (not much use of OOP and lots of global variables). And the game is just barely held together with duct tape. Although I am basing all of this on the version on SourceForge.

Actually, I am exaggerating a little bit. Of course you can learn some useful stuff from LCS's source. I got a grasp on PDCurses by looking at the source. And I'm sure that if you're a complete newbie to C++ you could learn some basics. Just don't go picking up any coding habits.  :P

Hehe, I'm learning the syntax, not the methods :P

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #3104 on: October 17, 2012, 08:49:42 am »

I strongly recommend that you learn your syntax elsewhere.
Logged
Pages: 1 ... 205 206 [207] 208 209 ... 796