// map 1
if (map = 1)
{
cout << "this is map 1\n";
}
// map 2
if (map = 2)
{
cout << "this is map 2\n";
Type: Posts; User: cakey
// map 1
if (map = 1)
{
cout << "this is map 1\n";
}
// map 2
if (map = 2)
{
cout << "this is map 2\n";
whatpulse.org
Yeah, i was thinking about adding to the list as it was finding primes so there was no precalc, it just did it as you went along, but i don't know how to impliment that kind of variable array or...
Ok I've ended up with 3 different logics, the first two are very similar in speed, while the last one is quite a bit slower then causes one of those windows program has encountered an error and has...
ok i added that and it has sped it up to a stupid speed xD
#include <iostream>
#include <math.h>
using namespace std;
// varaiables
int num=0;
Therefore double the amount of commands, pointless or not thats exactly what im trying to do; make it as fast as possible.
i tried that option, but wouldnt that mean an extra if command which would probably slow it down?
I decided to make a small program that found prime numbers, and after an hour or so of tweaking i came up with something that was about 30 times faster than my first attempt, however I still have a...
Yay! Thats the last time I recall a function instead of using a loop: FIXED:
int aichoosemove()
{
aiboard[0][0]=board[0];
aiboard[0][1]=board[1];
aiboard[0][2]=board[2];...
Have you spotted the problem and now trying to help me find it, while me still doing the work, or just suggestign where i should start?
Either way I can't find it.
Will return just breakout of...
No, thats not the problem, it only takes unoccupied squares, but it takes multiple turns when it should only take one.
Have a tic tac toe program which works fine expect the computer decides to cheat every once in a while.
If after making a move it can then win by making another move, for some reason it makes that...
http://edais.mvps.org/Tutorials/TTTAI/index.html
Decided to now try and add intelligent ai to the game, and realised it will probably make my life a lot easier if I changed the array into 3x3, are there any complications to this, or anyway that...
Also another question, not related but I didn't think it deserved a thread of it's own(too many already).
I have both:
Dev-C++(4.9.9.2) - Currently Using
Visual C++ 2005 Express Edition
...
dam i suck
Ok, cleaned up the code, merged some functions, deleted others and enabled it to detect a draw...
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
// ...
What's the exact difference between ++i and i++? I know it's something like changing the variable before or after its used in the statement, but only ++i works while i++ makes everything explode ;)
Yeah, I see what you mean, im guessing its something i'm just going to have to do and will eventually become automatic.
Anyway, thanks for the other advice and the compliment. Talking of...
Thanks a lot =)
Knew it was something simple, just ha dno idea what...
Updated code: Any other tips?
#include <cstdio>
#include <cstdlib>
#include <iostream>
I've decided to dive into the world of C++, and decided as my first attempt i would try making a simple tic tac toe/noughts and crosses game. Basic i know, but im just starting =(
The game works...