C++ :: Connect Computers To Play Game?

Nov 16, 2014

I have a Blackjack game that allows users to create a login account and it keeps track of their bet amount, and total bank,etc. How can I connect the program on 2 or more computers so that people can play together?

(A) How would I code it? (B) Can I just connect a USB or HDMI and use the appropriate code? (C) Do they need to be executables instead of just running out of Visual Studio? (D) Can this maybe done over Wi-fi? (E) Or is this something more complicated like over a VPN?

View 2 Replies


ADVERTISEMENT

C++ :: Program To Play Numbers Guessing Game

Dec 14, 2014

"Write a program to play a numbers guessing game. The user thinks of a number between 1 and 100 and your program asks questions to figure out what the number is (e.g., "Is the number you are thinking of less than 50?"). Your program should be able to identify the number after asking no more than seven questions. Hint: Use < and <= opeartors and the if-else construct."

What I've managed so far, but what I have seems to be lacking

Code:
#include "../../std_lib_facilities.h"

int half(int guess);
int going_up(int i);

int main()

[Code] ....

View 4 Replies View Related

C++ :: Rock Paper Scissors Game - How To Add Play Again Option

Apr 1, 2014

So , i had to make an rock paper scissors game . After lot of hard work and struggle ,I completed it but my professor rejected it since I didnot add option where it says "Would you like to play again .Y/N " . The code has too many brackets ! Here is my code

#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;

// for displaying the outputs to the user; passing string to functions
void user_win() {

[Code] ....

View 1 Replies View Related

C++ :: Number Guessing Game - Play Again Loop Broken

Sep 11, 2013

OK, so the program is working minus the play again loop. I even tried a goto statement for it but no luck. Basically what its doing is after the game runs its course it asks if you would like to play again? If you hit Y it starts over but if you it N it starts over. I want it to out put thank you for playing and close after user hits a button.

// C// Guess My Number
// The classic number guessing game

#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;

[Code] ....

View 1 Replies View Related

C :: Creating A Kind Of Connect 4 Game

Nov 14, 2014

I'm creating a kind of connect 4 game that will be due on November 30. I'm starting now so that I don't have to worry about it as much later. Anyways, I just started, and I already have some questions/problems. I want to be able to change that numPlayers outside of the function, so I used pointers like my instructor said to, but it is giving me an error that numPlayers(the argument) is not an int*. How do I fix this?

Code:

int numPlayers=0;
void promptNumPlayers(int *numPlayers)
{
printf("Enter the number of players: ");
*numPlayers=readInt(stdin);
if (*numPlayers != 1 && *numPlayers != 2)
}

[code]...

View 3 Replies View Related

C++ :: WinSock - Can Connect To Localhost But Cannot Connect To IP

Dec 22, 2013

I'm getting error ID 10061 - WSAECONNREFUSED - No connection could be made because the target computer actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host—that is, one with no server application running.

However, when I use 127.0.0.1 or localhost dns, everything works fine, Im connecting to the ip from [URL] .... with port 1337 ...

View 4 Replies View Related

C/C++ :: SDL App Not Working On Other Computers

Jun 2, 2013

My SDL app which i made in visual c++ works properly on my pc, but it does not even starts on other computers. I have pasted all the required .dll files in my debug folder along with the pictures and sounds.

View 4 Replies View Related

C++ :: Connecting 2 Computers Over Internet

Oct 19, 2014

I'm trying to make my 1v1 game playable online and I would like to have the 2 players connected directly rather than trough a server.

The problem I'm having is that I don't have any experience with server client communication or internet libraries in c++

View 4 Replies View Related

C :: Program Produces Different Results On Different Computers

Feb 13, 2013

I was doing problem 10 on project euler Project Euler. The following code produces two different answers on different systems:

Code:
#define INPUT 2000000
Bool isPrime(const int number) {
int i, sqr = sqrt(n);
if(n%2==0) return 0;
for(i=3;i<=sqr; i+=2)

[Code] .....

Computer A:
Linux 3.0.0-30-generic #47-Ubuntu SMP Wed Jan 2 22:39:01 UTC 2013 i686 i686 i386 GNU/Linux
gcc (Ubuntu/Linaro 4.6.1-9ubuntu3) 4.6.1
Ubuntu 11.10

Computer B:
Linux 3.2.0-31-virtual #50-Ubuntu SMP Fri Sep 7 16:36:36 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Ubuntu 12.04

Compiled by: gcc program.c -o run -lm

Computer A generates this answer: 1179908154 (wrong)
Computer B generates this answer: 142913828922 (right)

My guess might be because they are running on different architectures. But I really don't know.

View 3 Replies View Related

C++ :: Program That Executes A Command Between Computers

Jul 28, 2014

I'm currently making something with C++ for a computer at my house. I have a program in which I let run minimized and hidden on my home computer which will save any application that is opened. It will log it so I know if my kids are on my office computer (they shouldn't be.).

I'm curious as to if I can make the program linked to a program I make on my work computer (at my workplace) and execute a command. I'm interested in making it so I can always be connected from the Workplace app to the Home Office App.

My idea for the program is to have a sort of administrative way of shutting the computer down or locking it remotely. If I see they are using the PC in my office, I want to be able to simply type a phrase and shut the computer off or lock them out.

View 1 Replies View Related

C++ :: Transfer Files (mainly Images) Between 2 Computers?

Oct 1, 2014

I need to transfer files(mainly images) between 2 computers using their RAM with some kind of FTP. I'm using C++. I guess it's pretty a lot to explain so if you have a clear and detailed articles/videos

View 8 Replies View Related

Visual C++ :: Application Won't Start Once Installed On Other Computers

Sep 13, 2012

I use standard libraries and INNO Setup, wich is a free setup file creator.

I succeeded in adding NetFrameWork 4.5 installer into the setup (it runs it after installation, and before running my software (named GOFINDER).

Now, i remember that this happened to me, but after three months of programming, mine used to start and still does. But I know it sometimes doesn't start, and I don't know why exactly.

I checked to make sure that I needed only FrameWork 4.5.

But maybe it is because of Visual C++ Runtime wich is not added upon setup.

I will try to check this after posting cause this has just popped up in my mind.

I'm asking you how can I Make sure, that distributing my software won't do that anymore.

Is it because my application file is not set on Run as Administrator?

Cause normally, it opens without this necesity, except as a Shell (well I have to check back but I think it does if I check on the run as administrator checkbox.

The problem is not really with InnoSetup, but I also would like to know how I can check that box automatically upon setup.

they say they have a documentation but I don't find it on my computer.

And... why would it start on my computer, and not on my beta-testers's one?

View 3 Replies View Related

C++ :: How To Play Simple MP3 Through Mic

Jul 21, 2014

How do I play a simple mp3 through my mic. I plan on using this to just play annoying sounds through skype and games(on windows 7 btw).

View 6 Replies View Related

C++ :: How To Play WAV File In A Program

Mar 6, 2014

I understand how to play a .wav file in a program, but I am attempting to "package" the .wav file with the project so that it can be played by another person, on a different machine (namely, my professor). The way I have come to understand this is that if you use the following line of code:

PlaySound(TEXT("C:WindowsMedia
otify.wav"), NULL, SND_FILENAME);

The sound file would not play if it is not in the same location on the other computer. Am I correct? Assuming that I am, I have added the file that I wish to play as a resource in my project, but I can't figure out how to make it play. Looking at MSDN (and other resources) I found the following snippet:

#define MAKEINTRESOURCE
PlaySound(
MAKEINTRESOURCE(L"notify.wav"),
GetModuleHandle(NULL),
SND_RESOURCE);

I get no errors when I build the program, but no sound plays when I run it. I have tried for hours now to figure this out (which is usually enough time for me to sort through the problem) but I have met with no success. This leads me to believe I am either completely off in my assumptions, or I am making a silly mistake.

View 6 Replies View Related

C :: Program To Play Lottery - Limit Between 100-99?

Feb 2, 2015

Suppose you want to develop a program to play lottery. The program randomly generates a Lottery of a three-digit number( any number from 100 to 999), prompts the user to enter a three-digit number, and determines whether the user wins according to the following rule:

1. If the user matches the lottery in exact order , the awards is $100,000.
2. If the user input matches the lottery digits, the awards is $50,000.
3. If two digit in the user input matches a digit in the lottery, the awards is $30,000.
4. If one digit in the user input matches a digit in the lottery,
the awards is $10,000.

Sample:
The winning number is 865.

Your ticket is 865 then 100000
Your tickect is 686, or 568,.. all digits are right but not in order
You get 50000
Your ticket is 860, or 186 .. then 30000
Your ticket is 800, 706, 600.. just one digit much you get
10000
Else
0

Im using if/else statements. Which syntax would I use to figure out the limit between 100-99?

View 1 Replies View Related

C++ :: How To Play Sound When The Program Ends

Jul 16, 2013

How can I play sound when the program ends? I am using Windows 7.

View 15 Replies View Related

C :: Can Play Audio Without Extra Window Showing?

Jul 7, 2013

I got this code from a wiki that taught me how to make C code that plays audio, and with a few changes I was able to get it to take a command-line argument as the music file name. Here it is

Code:
#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <SDL/SDL_mixer.h>

int main(int argc, char *argv[])

[Code] ....

The only problem is, even though I guess it needs to create a window to work with SDL, is there any way you could hide it or something so the user can't see it? I don't really want to see it ( I'm planning on running it from Batch files or C applications as an easy way to play an audio file once ), because if I did, I might as well just use a default audio player instead.

View 3 Replies View Related

C :: Play MP3 File And Delay / Fgets In One Function

Jul 2, 2014

How can i play a mp3 file in the background?How can i rule the volume of the mp3 file?why does delay(0.25) doesnt work in this code?

Code:

FILE *datei;
char line[ANZAHL][LAENGE];
int i ;
datei = fopen ("song.txt", "r");
if (datei != NULL){
for(i = 0; i < ANZAHL;i++) {
delay(0.25);

fgets(line,LAENGE,datei);
printf ("%s

[code]....

View 2 Replies View Related

C++ :: Resetting Board On TicTacToe In Order To Play Again

May 25, 2014

How to reset the board in order to play again without spots already taken.

#include <iostream>
#include<cstdlib>
#include<ctime>
using namespace std;

char location[10] = {'0','1','2','3','4','5','6','7','8','9'};
int displayMenu(int &player, int &win);

[Code] .....

View 1 Replies View Related

Visual C++ :: Add USB Plug And Play Feature Inside DLL

Nov 5, 2013

I have designed a vc++ dll for a controller. I want to add usb plug and play feature inside the dll. I searched on line and came to know:

"If the project is an unmanaged C++ DLL project, then I can only create windows in an unmanaged way, i.e. the usual Win32 API way, such as adding a new dialog box as a resource, or simply using RegisterClassEx() and CreateWindowEx() to create the window yourself, then pump messages for those windows using GetMessage(), TranslateMessage() and DispatchMessage()."

how to use this concept.

I have created a separate application (in delphi 2007) that load this Dll. But I want to add this Plug and Play feature inside me dll.

View 11 Replies View Related

Visual C++ :: Play Youtube Videos In Application?

Mar 26, 2014

I am just at the starting point of this subject. How do i add a video player to my windows form application in vc++?

Can I link youtube videos to that player to be played?

View 2 Replies View Related

C++ :: Game Design Practice For Accessing Container Of Game Objects

Dec 21, 2014

I'm working on my first video game. So far I have a few classes in the game starting with the Game class which includes a list of GameObjects (another class). There are several classes that inherit from GameObjects used to implement things like bullets, explosions, various enemy types, etc.

The game essentially iterates through the list of GameObjects to update/render them. I would like to provide access to the Game's list of GameObjects inside another class (like the Bullet class) so I can put new objects on the list. For example, when a bullet hits, I want to add an explosion to the Game's GameObject list it can be updated/rendered.

How this should be setup? I was considering adding a pointer to the Game or GameObject list to the GameObject class (and methods to access it), but I was wondering if there is a better way to set this up?

View 4 Replies View Related

C++ :: Program For Calculating Total Price Of Game Station And Game

Sep 13, 2014

I would like to make a program for calculating the total price of a game station, and a game. I made a program like this for just the price of a game in class, but I want to make one that does the game system as well.

View 7 Replies View Related

C++ :: Create A Program That Will Play MP3 But Also Display Word File?

Jun 5, 2013

i want to create a program (in c++ or c#) that will play mp3 files but also display a word file with the lyrics of the mp3 song playing. so if i choose a mp3 file from a list, the lyric file for that song should also be displayed. i have all the mp3 and lyric files saved on the computer so my problem is how can i link the files?

View 5 Replies View Related

C/C++ :: Play Scales At Certain Frequencies - Creating Array Within Class

Jun 24, 2014

I'm trying to create a program that will play scales at certain frequencies, but my arrays are not initializing correctly. I've read up to double check what i'm doing but it doesn't seem to be working. My only guess is my use of a global variable.

const int NotesInScale = 8;
class Scales {
private:
//all Major Scales
int CMajor[NotesInScale];
int GMajor[NotesInScale];

[Code] ....

i'm simply trying to put the frequencies in the scales (the numbers in the array) but I keep getting an error. I feel its a simple fix but i'm not seeing it.

View 8 Replies View Related

C++ :: Play Audio File As Background While Executing Other Operations

Jun 6, 2013

I need to make a program which can play a audio file as background while executing other operations .

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved