SgtMe 46 Veteran Poster Featured Poster

"Collapse" - Saosin

SgtMe 46 Veteran Poster Featured Poster

517

SgtMe 46 Veteran Poster Featured Poster

Pah sure you did ;) Just respectfully let her know...
Don't worry bro I'm just joking :)

SgtMe 46 Veteran Poster Featured Poster

Hi there!
Welcome to DaniWeb.
Hope you have a good time here :)

SgtMe 46 Veteran Poster Featured Poster

*wolf whistles*

SgtMe 46 Veteran Poster Featured Poster

513

SgtMe 46 Veteran Poster Featured Poster

'Cos the free community isn't getting paid, so there's no incentive.

SgtMe 46 Veteran Poster Featured Poster

Is there not an installation tutorial on NeHe?

SgtMe 46 Veteran Poster Featured Poster

509

SgtMe 46 Veteran Poster Featured Poster

505

SgtMe 46 Veteran Poster Featured Poster

501 :D

SgtMe 46 Veteran Poster Featured Poster

unique -> different

SgtMe 46 Veteran Poster Featured Poster

oh i love conspiracy theories :D

SgtMe 46 Veteran Poster Featured Poster

497

SgtMe 46 Veteran Poster Featured Poster

493

SgtMe 46 Veteran Poster Featured Poster

I'm guessing you'd download the appropriate headers and libraries and dump them in your compiler/IDE folders. If you want something simpler, have a look at Allegro. What IDE/Compiler are you using anyway?

SgtMe 46 Veteran Poster Featured Poster

If it is a compiled executable, no.
You can obviously view the code of open source games, but I take it you mean commercial games.
Technically you can decompile code, but it's highly illegal.

SgtMe 46 Veteran Poster Featured Poster

In your code, you have a kind of double negative here:

while not n == 0:

This is saying that "while 'n' does not equal 0", do stuff.
A simpler way of writing this is "while n != 0:".
The "not" is only really used for boolean. ie:

a = True
while not a:
	print ':)'

the "not" effectively means "false". So: "while 'a' is false".

In your code, you have a kind of double negative here:

while not n == 0:

This is saying that "while 'n' does not equal 0", do stuff.
A simpler way of writing this is "while n != 0:".
The "not" is only really used for boolean. ie:

It looks rather like you are going to use the first bit :)

Just a note: a more convential way of doing this starts at zero and counts to 'n', not the other way round. It won't make any difference, it's just a convention.

Line 3 could also be:

n -= 1
SgtMe 46 Veteran Poster Featured Poster

esteem -> self

SgtMe 46 Veteran Poster Featured Poster

Liking the above suggestion from flukebob. May take a little bit to put right (having to change every mention of the current arrays and restructure some parts), but it would definitely be worth it. Have a shot anyway and come back to us.

SgtMe 46 Veteran Poster Featured Poster

489

SgtMe 46 Veteran Poster Featured Poster

515

SgtMe 46 Veteran Poster Featured Poster

What are the errors? You could also reduce the amount of variables that you have by a fair way. Instead of using "int lvl1", "int lvl2" and so on, just use an array.

SgtMe 46 Veteran Poster Featured Poster

"Almost Easy" - Avenged Sevenfold

SgtMe 46 Veteran Poster Featured Poster

Nah. I'd keep 2.55. I had another go last night and it's gradually becoming clearer. I'm currently modeling for someone's game so I'm staying with 2.49b because I can work so much quicker. If your just starting out, I'm not sure which you should go with. I would say 2.55 because it's up to date, but I'd say 2.49b, 'cos it's simpler and there are not that many 2.55 tutorials at the moment. Your choice :)

SgtMe 46 Veteran Poster Featured Poster

"The Darkest Nights" - As I Lay Dying

SgtMe 46 Veteran Poster Featured Poster

sorrow -> tears

SgtMe 46 Veteran Poster Featured Poster

515

SgtMe 46 Veteran Poster Featured Poster

Nah it's cool :)
It's 'cos I didn't spend much time learning classes before I went to Python, and now I've come back (sort of), I've forgotten it all :'(

SgtMe 46 Veteran Poster Featured Poster

You show effort.
I wait.

jonsca commented: Nice +5
SgtMe 46 Veteran Poster Featured Poster

Sorry I was looking at it the wrong way. You see I'm confused about the thing with classes where you have to do something funny and...oh I dunno... :(

SgtMe 46 Veteran Poster Featured Poster

Take the printing for whoever got the highest gold out of the loop and have that after you print the table. Not sure what you mean by the ampersand. Where do you want to add it? I'll have a look at it again in a little bit.

SgtMe 46 Veteran Poster Featured Poster

When you define a variable, you need to give it a value. Change these lines to what I write:

In production.h
Lines 9 + 10

int shift=0;
double payRate=0;

In main.cpp
Lines 12 + 13

int number=0;
int date=0;
SgtMe 46 Veteran Poster Featured Poster

Welcome the DaniWeb :)


I had this problem a few days ago. I always thought that you could define a variable like this:

int a;

but it always picks up a weird value and not zero like I would have thought. Make sure that all your variable definitions are defined to (eg.):

int a = 0;
float b = 0.0;
string c = "";

etc.

If this helps, upvote the post. Thanks :)

SgtMe 46 Veteran Poster Featured Poster

When you have the "return" statements, ie.

{return title;}
//and
{return price;}

You shouldn't have braces. It should be:

return title;
return price;
SgtMe 46 Veteran Poster Featured Poster

We won't do your homework for you. Without you showing a decent amount of code you have written (ie. effort), we will only link you to places that can get you on the right track, and we will NOT give you bits of code. Sorry, but it's the rules.

SgtMe 46 Veteran Poster Featured Poster
Country Gold Silver Bronze total
------------------------------------------------------
Canada 3 2 1 6
The country with the highest gold count is 6
with 6 gold medals
China 2 5 1 8
The country with the highest gold count is 6
with 6 gold medals
(and so on...)

I take it you want the output to be "The country with the highest gold count is <country>" and not "The country with the highest gold count is 6". This is what you put in your "wanted output".

On the output line 4, you are getting the country name as "6". This is because "HighsetSoFar" is the index to the array value of the country/medal count, NOT the actual value. Say index 5 had the most gold medals. You need to find out which country relates to index 5. There is also something wrong with your printing, seeing as it tells you who got the most golds repeatedly.

SgtMe 46 Veteran Poster Featured Poster

"I Get Off" - Halestorm

SgtMe 46 Veteran Poster Featured Poster

That's because you are using blender 2.55
The instructions you were given are for 2.49b and earlier.
If I were you, I would use 2.49b
2.55 confuses the heck out of me :/

SgtMe 46 Veteran Poster Featured Poster

I see what you did with the word "bone" -_-

:L

SgtMe 46 Veteran Poster Featured Poster

507

SgtMe 46 Veteran Poster Featured Poster

509

SgtMe 46 Veteran Poster Featured Poster
SgtMe 46 Veteran Poster Featured Poster

If the last letter is b or d or g etc., then add "word[wordlength]" on the end, nad then add 'er'. Just use a compound if statement to test for all the letters.

SgtMe 46 Veteran Poster Featured Poster

Now onto your code:

1. The length of the array will be the amount of countries whose medal count you want to compare.

2. If you only want to find the highest gold, I suggest making a new array that only contains how many golds each country has. This should be simple to do (have a quick google if your not sure). Then you can pretty much use the logic in my code.

SgtMe 46 Veteran Poster Featured Poster

OK I'll break it down line by line. The line numbers reference the code in my above post.

Lines 1-4:

#include <cstdlib>
#include <iostream>

using namespace std;

The top two lines mean that we include the cstdlib and iostream libraries in our program. You will need iostream, but you don't really need cstdlib. It's just there when I start a new project in C++.

Lines 6 - 7:

int main()
{

This is obviously the start of your main function. You would want to make this into a separate function, so you can call it whenever you need it. I just made it in main because it's much quicker when I'm doing a demo.

Lines 9 - 17:

//variables
    //length of array
    const int len=5;
    //array of numbers. Obvs. 24 is highest
    int arr[len]={3, -1, 24, 10, 16};
    //index of current highest
    int HighestSoFar=0;
    //loop until we have tested each array value
    int i=0;

The variable "len" is the length of our array. I made the variable because we need to use it again in the loop that goes through our array. It has to be in the loop as the limiting value (ie, while (i<len) etc.), otherwise we end up trying to get array values that haven't been initialized and our program crashes. You cannot make an array of variable length in C++, so we have to use a "const int". This, as you might guess, is a contant integer that cannot be …

SgtMe 46 Veteran Poster Featured Poster

509...sweet...back over half way...do you think the other team are bothering?

SgtMe 46 Veteran Poster Featured Poster

last -> lost

SgtMe 46 Veteran Poster Featured Poster

487 night :)

SgtMe 46 Veteran Poster Featured Poster

461