WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
While loop until no more numbers
  set intervalStart to current number
  Loop until you don't get the "next number" in sequence
  Set previous number to intervalEnd
  print interval
endWhile
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Also use a vector as the array isn't contingously aligned.

It isn't? Please explain...

And why do you guys always suggest vectors when they are obviously beyond the scope of their knowledge? What do you think would happen when they turn in their homework with vectors which hasn't been taught???

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

what will print

Nothing. There are no output statements.

Assuming that's not the correct answer, sit down with pen and paper and figure it out.

Write down the variables and their contents
Write down the pointers and where they point
Now follow the code statement by statement

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Why 0-5, 6-9, 12-13?
Why not 0-3, 4-8, 9-13?
Or 0-1, 2-3, 4-5, 6-8, 9-13?

My attempt is here, but there is a problem with this:

So what's the problem with this?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I would like to ask only a good algorithm for this problem.

Then explain what you don't understand and IN DETAIL explain what you need the program to do.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
#1:

Given

const int BOARD_COL_SIZE = 7;
const int BOARD_ROW_SIZE = 6;

why are you using the values 6 & 7 in the code:

for(int i = 0; i < 6; i++)
{
    for(int j=0; j<7; j++)
    {
#2:

Make your checkWinner() check each direction individually, not in one convoluted loop.

Set up separate nested loops for each of the directions to check, even the diagonals.
During each inner loop count player positions. But each time you find an opponent's value, reset the counter to 0. Any time the counter reaches 4, return TRUE.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

My boss has seen this & has disabled the dowloading of videos from my computer.

Doesn't that sentence tell you anything?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Yeah, so? Why would anyone want to do this? It's hard to understand and using a temp variable is clean and understandable.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Can you be less vague?

Not one win condition works?
Some work but not others?
All but one works?

And where should we start looking?
This is like looking for a needle (vague idea what we're looking for) in a haystack (371 uncommented lines of code)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

For those interested here it is. Now how do you delete posts?

If the post was deleted, why would we be interested? ;o)

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Plus, there are also reasons why we have it within the actual post area instead of immediately below. The first reason is, at the suggestion of the Google guy, it significantly increases the click rate as opposed to being in its own box immediately below the post. Secondly, most short posts end up having white space immediately below the message because of the medium rectangle ad to the right. By putting this whitespace to use, we are able to reduce scrolling required on nearly all pages. If you look at this thread with ads enabled, for example, you'll see that by having the related article where it is, instead of immediately below the post, we're saving about six lines of scrolling.

Now that all makes sense. I withdraw my objection now that I understand the reasoning.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

total=total+(pow(n,i)\fact(i));

Take a closer look at this equation. Specifically the math symbols.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Unfortunately, we can't see your screen to see what the errors and warnings are.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Depends on how blocks is ultimately defined.
Depends on what length(blocks) returns.
Depends on what size(blocks) returns.
Depends on what sum(size(blocks)) returns.

There are a lot of possibilities on each of the above. Unless there's a Matlab user that can answer these questions, we'd be just guessing.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Now you're complaining that you don't like either :)

When did I say I didn't like it at the bottom? I didn't mind it there.

I only said I don't like it embedded inside a post. Immediately after the post makes more sense to me.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Yes, it's precision, and double is simply more accurate. That does not equate to bigger.

For example: double may be 56.42735816, float may be 56.42736 -- float is bigger.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

It points to valid memory most of the time. It can be null but I've already checked previously

But what if it's not zero AND it points to invalid memory?

Looks like you're going to have to use the debugger to follow the code and see where the problem happens.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Just checking. Sounds just like all the expert resume writers. No expert has the same advice, so listening to them causes you to continually rewrite your resume and rip your hair out. Sounds like your experts are the same. All you can do is try all the suggestions and see...

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Most likely mis-matched braces. If you would indent in a consisent manner , that type of error would never show up.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Can't tell from what you posted whether BufferData points to a valid buffer or random memory. That's could be why you get different values.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Ewwww. Did you get any second opinions?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

And why is the related article imbedded in the first post? That just seems wrong since it wasn't posted by the OP. At least put it after the post.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Then, as deceptikon says, it's not supported by that compiler. Write your own.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

plz try to understand please read deceptikons msg he tells you correct stuff and dont cry be a big boy and stop begging you sound like a whiney 3-year-old and you must be 13 years old to post here

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

And Labdabeta, what do you mean by arbitrary arithmetic library ?

Bad choice of words. He means a large-number arithmetic library? Arbitrary is not correct. You want to pick a package with care.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

First things first:

I am not very fluent in c++

Get fluent in C++. Put the bots on a back burner, you're not even ready for the game yet.
1) Learn C++ extremely well.
2) When you have learned C++, write a few simple games.
3) When you're ready, start tackling yout mmorpg.
4) Then you'll be ready for your bot-killer.

And as for a flash game -- it might teach you something about programming a game, but won't get your ready for C++ games. I question its usefulness.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

If people would stop responding to these posts, we could actually do something about them.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Which is the best compiler for C++ development for latest versions of OS like the 64 bit windows?

Best? What makes you think there's a best? If there was a best, there'd only be one choice.

The DEV C++ compiler is a good option but I find it problematic for file handling.

What's that mean?

Visual C++ is also a good alternative but I couldnt find any command for compiling and running the code.

It's there. It's called RUN. Probably under the DEBUG menu.

G++ compiler is good but it does not support the windows header files.

Windows header files are not standard and only work on Windows O/S. There are many other O/S's out there so you are limiting yourself if all you want to use are windows headers.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

You can just use the top navigation menu dropdown links

Sure. But I have to do a lot of scrolling which I don't find user friendly.

As for

many people complained that the "favorite" forums it showed weren't where they wanted to go usually

what about us that liked it and, because it wasn't a complaint, didn't rave about it? I remember commenting on it favorably.

And for those that can't use it because of the above, they don't have to use it. Just like no one has to use TAGs, but they are there for the few that do.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Two gold stars. What's next?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

flower braces?

() these are called parentheses -- or parens to those in the business. (we're lazy)
[] these are square brackets, or for us lazies, just brackets
{} these are curly brackets/braces, know simply as braces in the industry.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

[pedantic]
Since the hottest recorded temperature is a mere 3.6 billion degrees, why would you care if the program worked for 10 Quattuordecillion?
[/pedantic]

Actually, the problem is the limits of binary math. 45 digits is too many for computers handle. The only way to cleanly deal with numeric abnormalities with any certainty is to input everything as strings and do a verification before converting to binary.

And before anyone says "don't use CodeBlocks -- it's too old" see this

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

I'm confused.

You enter your number into a string named string then start processing a variable named r. Where did r come from? How do you do math on a string?

First thing's first:
Write down the steps you take to translate a decimal value into a binary value -- on paper.
Once you have that written and verified that it works, you convert that into your code.

The problem you (and most new programmers) have is sitting in front of a keyboard with no plan at all and expect code to just fly into the computer. It won't work. Start at your desk and
1) Write down what you need to do. Make a plan
2) Then turn that plan into steps.
3) Break those steps into smaller steps.
4) Verify these steps work as you go.
5) Repeat 3 & 4 until there ain't no more.
6) Last thing is type the code into the computer.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague
cout << ((rand() % 2) ? '1' : '3') ;
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Hope it helps :)

Probably not, since this was already suggested and rejected.

You should read the entire thread before posting.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Why do you need to PM anyone? Getting help is done by posting in the forums.

Read the Member Rules.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Is induntation legal in your country?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

@Ayoub:

Hopefully smarter members will give you an answer, but the question is "how far did you get?", and "what has you stumped, now?".

Hopefully, after 8 years he's a little farther on in the program...

Didn't any of the other posts clue you in?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Maybe

x = rand() %2;
if (x == 0) x = 1;
    else    x = 3;
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

WaltP, it was CONT actually, not i

Not in the code you posted. We can't tell if you post bad code.

I don't understand why the k=atoi(argv[1]) is not working !!!!!!!

How do you know it's not? What was the value of k when you tested it by printing it out?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Me too. But rogernick and np complete must have thought you were confusing.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

In the loop what is the value of i?

Ancient Dragon commented: Oops missed that one :) +14
WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

What is it with you guys???? I said I already answered it. And you asked it again! Look at the damn answer from 2 days ago!

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Start with formatting.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Lucaci Andrew basically said: "test for invalid input"
NathanOliver said ... "you need to use a loop"

After these two posts:

rogernick said "Did you try using a loop method?"
np complete said "Try using loop for inputing and displaying ... checking whether input is [invalid] or not"

It helps to have an original thought, not just parrot what everyone else said. Was your wording better or more understandable?

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Unfortunately, the one entry on the bar I used to use is missing -- The Favorite Forum links.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

What does "not working" mean? Details.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Is i0 and i1 variable names? If they are that means I have to have to counters for zero[] and one[].

Of course.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

This usually means object is just a pointer -- there's no storage space.

WaltP 2,905 Posting Sage w/ dash of thyme Team Colleague

Is there anything specifically that would make my code look better?

yeah, the links.