Jump to content
MakeWebGames

[mccode v2] Battletent Fix


bocco
 Share

Recommended Posts

Well, i been talking to Killah and i got him to fix the battle tent for me. He did a great job. He told me he been wanting to do that for 2 years now, but no one has ever pushed him to do it. So i figured i would post it for him since it could take him another 2 years.

Great code though, i love his work.

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Just a small update he forgot to add

Link to comment
Share on other sites

  • Replies 56
  • Created
  • Last Reply

Top Posters In This Topic

Re: Battletent Fix

it's 250 lines because you seem to not fill the lines just add a little script like

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

rather than

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

now why exactly do you think something than can be done with one line should be done on 6 lines?

Link to comment
Share on other sites

Re: Battletent Fix

Everyone has there own way of coding. Please ask nyna why she add's 2 tab space's.

You code your way, i code my way, will see who like's what type better....

My way:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Your way:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Nyna's way (if im correct):

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Oh another thing,

Your way:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

My way:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

Link to comment
Share on other sites

Re: Battletent Fix

actually ill show you some of my new improved coding lol

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

OR

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

compare that to yours:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

(that is taken from breakin) your modification

Link to comment
Share on other sites

Re: Battletent Fix

 

what is it some trick ya use to make the file look bigger and get more money...

there are, in fact, some languages that error out if you do not indent properly. the idea is to make it legible so when you're working on team based projects the rest of your team can easily find, fix or add things.

in a introductory programming course in universities, professors spend a lot of time emphasizing this. when you try to get a job with a big corporation, if you present them with a portfolio full of messy programs, you're not going to get hired.

learning the etiquette is just as important as learning the syntax and control flow.

Link to comment
Share on other sites

Re: Battletent Fix

 

Break in mod is still part of my old coding...

My new way:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

I agree you are improving killah, but one thing that sticks out all the time when I read your code is efficiency.

You seem to have taken a liking to the wildcard (*), it should hardly ever be used, its rarely needed. Optimize your queries, only select the col's you need too. I'm sure your discover the speed improvement it provides, especially during looping.

Link to comment
Share on other sites

Re: Battletent Fix

I'm with Zero

if($blah) { echo 'Pooned'; $h->endpage(); exit; }

Fair enough the other way is easier to read, But I like it this way :roll:

Oh Zero, Shouldn't it be...

$sql = sprintf('UPDATE table SET blah=blah+%d WHERE meh = %d', 1,$meh);

$db->query($sql);

That's the way I'd do it :|

Link to comment
Share on other sites

Re: Battletent Fix

* is bad i never use that anymore

actually ill show you some of my new improved coding lol

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

OR

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

compare that to yours:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

(that is taken from breakin) your modification

 

Link to comment
Share on other sites

Guest Anonymous

Re: Battletent Fix

A quick look at the manual would give you the answer here...

%d expects a signed integer

%u expects an unsigned integer

I generally use %u, as I seldom have to add a negative number - i.e. my queries are written to take into consideration *exactly* the incoming data.

Using sprintf in this way is purely a convenience, the %u, (or %d) variables rather nicely convert whatever you have into an integer.

With games like MCCodes/DBS, even though the database uses signed integers all over the place (effectively %d's), it's quite acceptable to use %u. For example, with userid's.

Just make sure you test out the possible ranges -- MySQL is quite happy with some pretty big numbers, PHP is not quite so good, and sprintf is ... well lets just it works ... most of the time.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share


×
×
  • Create New...