|
i need anyone who can solve ma problem
Implement a game named as TIC TAC TOE in C++ with the help of 2D Arrays.
RULES & CONSTRAINTS:
• Tic Tac Toe is played on a 4 x 4 grid.
• Two players play at a time, one can place X’s on the board, the other O’s.
• Players have alternate turns.
• The player who obtains 4X’s or 4O’s first vertically, horizontally, or diagonally wins.
• The already occupied place cannot be reoccupied.
wali
|
|
|
|
|
And ? What is the problem ? Where are you stuck ?
(I hope you don't believe that we will do your homework for you ?)
|
|
|
|
|
wrote: • Tic Tac Toe is played on a 4 x 4 grid.
Wow. I must be old. Why, when I was a youngster, we played tic-tac-toe on a 3x3 grid.
You kids are crazy!
Oh yeah, which part is giving you trouble?
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
(Rex Kramer "Airplane!")
|
|
|
|
|
Mark Salsbery wrote: Why, when I was a youngster, we played tic-tac-toe on a 3x3 grid.
Inflation - it affects everything!
|
|
|
|
|
Is this a New Version of this game? It was Trivial on 3x3. Whoever started on 3x3 would be the winner, if (s)he started in the correct square. Maybe 4x4 is not trivial.
Looks like a Nice Homework project though.
You don't specify a User Interface. A common misconception I found amongst some budding programmers was that Windows and CPP are somehow the same. I can assure you, The're NOT. It is merely that Microsoft wrote a large body of code in cpp,to use windows. The body of code was called MFC for Microsoft Foundation Classes.
LateNightsInNewry
|
|
|
|
|
LateNightsInNewry wrote: Whoever started on 3x3 would be the winner, if (s)he started in the correct square
Are you sure? I seem to remember that unless someone makes a mistake, no-one wins (i.e. second player can always play such that first player does not win.)
|
|
|
|
|
i want to convert LPWSTR in to STL basic string.
Amit
|
|
|
|
|
USES_CONVERSION;
string s(W2A(myLPSWSTR));
that's one way.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
The STL has two typedef s which are shortcuts for specialisations of basic_string : std::string and std::wstring . If you're working with LPWSTR s then you probably want std::wstring . Here's an example:
std::wstring s = L"Hello";
Steve
|
|
|
|
|
hi all
i have coded an applications which gives the status of network. my application is running when the network gets disabled or when a network cable is unplugged. i am one more scenario where i need to run my application i e., when an firewall is installed. i need to run without setting the settings of firewall . i need to achieve it programmatically
kindly help!!!!
regards
sudhir
|
|
|
|
|
hmm If we could change firewall settings programmatically then they would't be very secure.
You didn't specify which settings you want to change but you could look into UPnP.
Some firewall/NAT devices have UPnP support (although most secure networks don't enable it I
imagine).
If the firewall is the Windows Firewall on XP and your app is running with admin privileges then
there's the Windows Firewall API as well.
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
(Rex Kramer "Airplane!")
|
|
|
|
|
Hi all
We are devolpping xpcom component to capture the events inn mozilla browser.Here we encounted the problem,when we enter an url on address bar of mozilla ,the address of perticula site nust displayed in messgebox.For that we have a lot confusion how handle the events like
Navigete before,navegate error,navigate complete.
plz give me a solution.
#sanroop#
|
|
|
|
|
Try it man.
Come online at:-
jubinc@skype
|
|
|
|
|
i have a command bar in my application that runs on WinCE module.
i need to increase the size of it. how do i do it???
i am using this to create the menubar.
if(SHCreateMenuBar(&mbi))
{
g_hwndMb = mbi.hwndMB;
TBBUTTONINFO tbbi = {0};
tbbi.cbSize = sizeof(tbbi);
::SendMessageW(g_hwndMb, TB_GETBUTTONINFO,0, (LPARAM)&tbbi);
g_hMenu = (HMENU)tbbi.lParam;
}
|
|
|
|
|
hi,
i have a ocx created, i add that ocx in a dialog based app.nw i need to set properties for that ocx in the dialog hw to do.i need to know the similar concept in vc++ as dat of property bag concept in vb
zari
|
|
|
|
|
Hello,
I have declared a variable like this:
UINT * p[2000*800];
and I want to send this variable through network using
winsock2.
And time is very important for me...
Thank you.
|
|
|
|
|
There's not enough information here. What have you done so far?
|
|
|
|
|
send(socket, (const char*)p, 2000*800*sizeof(p[0]), 0);
Of course I've omitted error handling and the possibility that all bytes don't get sent in one
call.
Are you sure you want to send UINT pointers across the network? Pointers aren't much use
except in the context of the process they were created in.
Mark
"Do you know what it's like to fall in the mud and get kicked... in the head... with an iron boot?
Of course you don't, no one does. It never happens. It's a dumb question... skip it."
(Rex Kramer "Airplane!")
|
|
|
|
|
hi,
I h've been reading on some openGL stuff and need some help with a simple program.
I want to display a cylinder with hole.
I am drawing cyliner with
gluCylinder(cyl, 3, 3, 5, 12, 12);
I want to set thickness of cylinder.
thanks in advanvce.
Rushiraj
|
|
|
|
|
I don't think OpenGL can do (or defines ) thickness of a surface.
You will need to draw one smaller cylinder (or bigger ) with a radius difference of the desired thickness, and draw the top and bottom trimmed surfaces to close up the top and bottom of the cylinder.
|
|
|
|
|
rushiraj.jhala wrote: I want to display a cylinder with hole.
the gluCylinder is some-what of a rough tool for this type of work. You can get into some of the super-ellipsoids or constructive geometry, both of which have their difficulties. You can also switch prototypes to a torus and scale it significantly in one direction. This does produce a rounded top rather than a flat. The other method is just to calculate it. A cylinder is easy to draw as it is just a circle with in an inner and outer dimension and a surface between the two. You could actually define the whole thing as one tri-strip by running a diagnal line around the inner and outer surfaces and meeting back up with itself at the end. 360 degrees, one tri-strip, makes a fast and easy surface to play with (this would be equivalent to a wrap torus, but with a flat inner-outer and top-bottom dimension).
Constructive Solid Geometry[^]
Wrap Torus[^]
_________________________
Asu no koto o ieba, tenjo de nezumi ga warau.
Talk about things of tomorrow and the mice in the ceiling laugh. (Japanese Proverb)
|
|
|
|
|
pls do help me in ending a process from the server without shutting down the remote host..
while using InitiateSytemShutdown() it forcefully closes and then shutdowns the system. but i need to end the process wihtout shutting down the system.
pls do reply as early as possible..
|
|
|
|
|
void EndProcess(string PID)<br />
{<br />
HANDLE ps;<br />
int id=atoi(PID.c_str());<br />
ps = OpenProcess(1,false,id);<br />
if(ps)<br />
{<br />
if(!TerminateProcess(ps,-9))<br />
{<br />
ShowMessage("Could not end process specified!");<br />
}<br />
else<br />
{<br />
ShowMessage("Process successfully terminated!");<br />
}<br />
}<br />
}
Is that what you want?
|
|
|
|
|
Hi,
I wrote a dll ,currently i was assigned to write a UNIT TEST CASE DOCUMENT,i don`t have a prior experince of writing unit test case document.what does unit test case document means..?i have around 20 functions in the dll. Does any one has the format of the unit test case document, sample document or related URL,kindly help me..i don`t know whether this is the correct forum to post...
Thanks in before
James
|
|
|
|
|
If you have around 20 functions in your DLL, then unit testing simply would mean testing each and every one of those functions individually for functionality, performance, or whatever you are intending to test it for. Unit Testing, in Wikipedia[^]
I am not ashamed to confess that I am ignorant of what I do not know.
- Marcus Tullius Cicero
|
|
|
|