Google premake, it's probably one of the easier choices
[editline]13th September 2011[/editline]
TerabyteS_
[QUOTE=TerabyteS_;32273392]Could you give me more information on how that works please? I'm currently compiling with MinGW.[/QUOTE]
Just use codeblocks or VS
[QUOTE=Werem00se;32273415]So, whenever I tried to convert Fahrenheit to Celsius in a one step line it gave me the wrong answer. No matter what I tried. So, I had to use this confusing line of code.
[code]double FahrenheitToCelsius(double fehrenheit)
{
double placeHolder = fehrenheit - 32;
fehrenheit = placeHolder * (5.0f/9.0f);
return fehrenheit;
}[/code]
[editline]13th September 2011[/editline]
Or is that acceptable?[/QUOTE]
you could have just done
[code]fahrenheit= fahrenheit- 32;[/code]
Post the line you wrote that wasn't working.
[QUOTE=RyanDv3;32274049]you could have just done
[code]fahrenheit= fahrenheit- 32;[/code]
Post the line you wrote that wasn't working.[/QUOTE]
I got it working, thank you so much. Results [url]http://www.mediafire.com/?3p40yk3kczh8423[/url]
[QUOTE=RyanDv3;32274049]you could have just done
[code]fahrenheit= fahrenheit- 32;[/code]
Post the line you wrote that wasn't working.[/QUOTE]
Don't you mean:
[code]fahrenheit -= 32;[/code]
Or alternatively,
[code]for(int i = 0; i < 32; i++)
{
fahrenheit--;
}[/code]
[QUOTE=RyanDv3;32272948]If I'm having trouble with the official version, trying the development snapshot seems foolhardy.
Anyways, I found a temporary workaround, so whatever. If anyone can explain why I'm getting those issues, do tell.[/QUOTE]
If you're having trouble with the 1.6 version (which I don't remember being supporting vs2010), then you should REALLY switch to 2.x-git. It's very much better, than trying your head at something like that old 1.6 version.
-snip- got it
[QUOTE=Kybalt;32275953]my java code. doesn't seem to acknowledge that two strings are equal, and also says splitLine[1] is arrayoutofindex, when it really shouldn't be.
[editline]13th September 2011[/editline]
also the file chooser code; which i completely copied of the internets.
[url]http://pastebin.com/frapLTw5[/url][/QUOTE]
I believe with Java you must use the equals methods when comparing strings.
[url]http://stackoverflow.com/questions/767372/java-string-equals-versus[/url]
As for your out of bounds issue. Do some bounds checking. If you split an empty line you will end up with an array that has only 1 element.
[QUOTE=T3hGamerDK;32275422]If you're having trouble with the 1.6 version (which I don't remember being supporting vs2010), then you should REALLY switch to 2.x-git. It's very much better, than trying your head at something like that old 1.6 version.[/QUOTE]
I'm only going to be using it for opengl, so meh. If I end up becoming overly dissatisfied I'll probably just resort to sdl.
[QUOTE=high;32276019]I believe with Java you must use the equals methods when comparing strings.
[url]http://stackoverflow.com/questions/767372/java-string-equals-versus[/url]
As for your out of bounds issue. Do some bounds checking. If you split an empty line you will end up with an array that has only 1 element.[/QUOTE]
the array was premade to have more than 1 element, but i got anyway, thanks though.
[QUOTE=RyanDv3;32276081]I'm only going to be using it for opengl, so meh. If I end up becoming overly dissatisfied I'll probably just resort to sdl.[/QUOTE]
I'm only using it for OpenGL as well. That's why you decide which "parts" of SFML you use and which parts you compile. You don't need to compile, for example, sfml-audio to get visual feedback.
[QUOTE=TerabyteS_;32272950]Does this mean that I'll have to specify every single one of the external classes' name when I compile? Oh god this sucks[/QUOTE]
No, but all the implementation files, or you can compile them into an immediate representation (object files) which can be linked together in another step.
And that's why you use build-systems, fancy editors or IDEs (or a combination).
I'm taking intro to object oriented design and I'm fairly new to programming. I keep getting the "cannot find symbol" error in line 23 and I have no idea why. My application is here:
[url]http://pastebin.com/JmH2jpaf[/url]
Here is my class file:
[url]http://pastebin.com/h73v229G[/url]
If someone could help I would appreciate it. Thanks.
[QUOTE=Hackintosh;32277312]I'm taking intro to object oriented design and I'm fairly new to programming. I keep getting the "cannot find symbol" error in line 23 and I have no idea why. My application is here:
[url]http://pastebin.com/JmH2jpaf[/url]
Here is my class file:
[url]http://pastebin.com/h73v229G[/url]
If someone could help I would appreciate it. Thanks.[/QUOTE]
You accidentally misspelled 'courseName' as 'className' on line 23.
I'm currently enrolled in a programming class in school and we've just begun to learn visual basic. I decided to dick around in C# a little bit and I've taken on the challenge of creating an incredibly simple game.
[img]http://filesmelt.com/dl/game4.png[/img]
When the 'Attack' button is clicked, a random number will be generated and subtracted from the enemy's health. The same will be done for the player's health. When the player's or enemy's health reaches zero, a message box will display a win/lose message. I am having trouble where the health variables will reset to 100 every time the button is clicked, even though I put the health variables outside of the button's click event.
[code] int playerHealthInt = 100;
int enemyHealthInt = 100;
private void attackButton_Click(object sender, EventArgs e)
{
System.Random randnum = new System.Random();
int playerHealth = playerHealthInt - randnum.Next(100);
int enemyHealth = enemyHealthInt - randnum.Next(100);
playerHealthLbl.Text = playerHealth.ToString();
enemyHealthLbl.Text = enemyHealth.ToString();
}[/code]
Sorry if I sound dumb. I'm new to programming.
[QUOTE=ryanmh12;32280361][code] int playerHealth = playerHealthInt - randnum.Next(100);
int enemyHealth = enemyHealthInt - randnum.Next(100);[/code][/QUOTE]
You're creating temporary variables here and assigning the new health into them. You want to replace the old variables that you made class-wide:
[csharp] playerHealthInt = playerHealthInt - randnum.Next(100);
enemyHealthInt = enemyHealthInt - randnum.Next(100);[/csharp]
Alternatively:
[csharp] playerHealthInt -= randnum.Next(100);
enemyHealthInt -= randnum.Next(100);[/csharp]
[QUOTE=ryanmh12;32280361]Sorry if I sound dumb. I'm new to programming.[/QUOTE]
Don't worry man. Even the best programmers have their moments. Many people at my uni even have their own "I'm a dumbass" song for occasions like this. :v:
edit: protip, use the csharp tags instead of the code tags. looks prettier.
You don't set enemyHealthInt to the updated value.
[editline]14th September 2011[/editline]
Ninja'd.
[QUOTE=benjojo;32269746]In x86 assemablly what is the best way to learn the drive that you are booting from. For example if the pc I am booting from has a different os on it's main HDD and mine is on a USB stick, how do I find what drive number I am so I can use int13h commands.[/QUOTE]
I [i]think[/i] the BIOS always assigns drive number 0 to the drive it's booting from, even if it isn't the "first" drive detected.
Are you sure scoreupdate_Tick is being called frequently? It may be working just not drawing the next score to the screen. In fact, why not just update the scorelabel in all of the HitAreaX_Click's? Maybe make your scoreupdate_Tick an "UpdateScore" method instead and call it any time you change the score.
Also, it might be worthwhile to look into arrays.
Just noticed: Why is there a random semicolon on line 221? :v:
[QUOTE=jalb;32282455]
Just noticed: Why is there a random semicolon on line 221? :v:[/QUOTE]
Because he's hardcore like that.
I've been doing some C++ tutorials lately and I have this urge to try something of my own after a few of them. I already have a simple program that has you put in 2 numbers, adds them and prints the answer but I wanna extend this to having the user pick between the big 4 of maths before giving the answer.
Thing is, I don't have the slightest idea on how to progress from what I have now. Anybody who can give me some pointers on how to proceed or improve my coding in general? Besides telling me that, as it stands, my methods are poorly designed?
[csharp]
// calculatorplus.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include "stdafx.h"
int DoAdd(int x, int y);
{
return(x + y);
}
int DoSub(int x, int y);
{
return (x - y);
}
int DoMultiply (int x, int y);
{
return (x * y);
}
float DoDiv (int x, int y);
{
return (x / y);
}
int main()
{
using namespace std;
cout << "Enter a number:" << enl;
int x;
cin >> x
cout << "Enter another number:" << enl;
int y;
cin >> y
cout << "Add, subtract, multiply or divide?" << enl;
void operation;
cin >> operation;
if (operation = add)
DoAdd(x + y);
else if (operation = subtract)
DoSub(x + y);
else if (operation = multiply)
DoMultiply(x + y);
else if (operation = divide)
DoDiv(x + y);
}
[/csharp]
-snip-
[QUOTE=thf;32283181]I see one fault with your program, and that's the usage of = instead of == in the if statements.
Other than that it looks fine.[/QUOTE]
Something fishy is going on here:
[quote]1>------ Build started: Project: calculatorplus, Configuration: Debug Win32 ------
1> calculatorplus.cpp
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(4): warning C4627: '#include <iostream>': skipped when looking for precompiled header use
1> Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(8): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(13): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(18): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(23): error C2447: '{' : missing function header (old-style formal list?)
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(31): error C2065: 'cout' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(31): error C2065: 'enl' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(33): error C2065: 'cin' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(34): error C2146: syntax error : missing ';' before identifier 'cout'
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(34): error C2065: 'cout' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(34): error C2065: 'enl' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(36): error C2065: 'cin' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(37): error C2146: syntax error : missing ';' before identifier 'cout'
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(37): error C2065: 'cout' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(37): error C2065: 'enl' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(38): error C2182: 'operation' : illegal use of type 'void'
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(39): error C2065: 'cin' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(41): error C2065: 'add' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(42): error C2660: 'DoAdd' : function does not take 1 arguments
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(43): error C2065: 'subtract' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(44): error C2660: 'DoSub' : function does not take 1 arguments
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(45): error C2065: 'multiply' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(46): error C2660: 'DoMultiply' : function does not take 1 arguments
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(47): error C2065: 'divide' : undeclared identifier
1>c:\users\erikvduyn\documents\visual studio 2010\projects\calculatorplus\calculatorplus\calculatorplus.cpp(48): error C2660: 'DoDiv' : function does not take 1 arguments
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========[/quote]
Hang on, bitchslapping myself for putting semi-colons when declaring my methods.
[QUOTE=Sir Whoopsalot;32283235]Something fishy is going on here:
Hang on, bitchslapping myself for putting semi-colons when declaring my methods.[/QUOTE]
Oh yeah, just noticed that too :v:
[QUOTE=thf;32283282]Oh yeah, just noticed that too :v:[/QUOTE]
That's what I get for doing this at 9 AM, I guess.
But why does it keep saying cin, endl and cout are undeclared and why is it complaining about my functions not taking 1 argument?
[QUOTE=Sir Whoopsalot;32283301]That's what I get for doing this at 9 AM, I guess.
But why does it keep saying cin, endl and cout are undeclared and why is it complaining about my functions not taking 1 argument?[/QUOTE]
Oh god, I just noticed quite a few other faults.
First, move the using namespace std; to the top of the file.
Also, when you're calling your functions, you're passing (x + y) to them. You should pass x and y by using DoDiv(x, y); and so on.
by the way:
[code]void operation;
cin >> operation;[/code]
you are trying to read something into a variable of type 'void', what won't work
in this situation you should probably use std::string
and in your IFs you are currently comparing 'operation' to (undefined) variables, you should instead write if (operation == "add") and so on
I installed [url]http://dev.mysql.com/downloads/connector/net/[/url] for use in visual basic express 2010. However, I cannot locate the mysql resource and add it to my project via add resource > .net tab > mysql.data.
New to vb.
I can't get my collision system to work.
The player is always shaking when moving into corners and I can't find out why?
[url]http://dl.dropbox.com/u/3192286/PlayerPhysics.rar[/url]
It's probably a simple problem, but I can't seem to find it.
Anyone please ;(
Working on a simple text based RPG.
[code]
int playerHealth = 100;
string playerName;
cout << "Lets start with your name, what is it?: ";
cin >> playerName;
if (playerName == "Toby" || "toby")
{
cout << "Good choice.\n";
}
else
{
cout << "Wrong. You are beaten with a whip. You take ten damage.";
playerHealth = playerHealth - 10;
cout << "Your name is Toby. Got that?";
}
[/code]
There's just a bit of it. Basically when you enter your name, unless it's Toby it should make you take ten damage. But no matter what I enter as a name, it outputs 'good choice'. I thought the else clause is supposed to execute if no other statements are true. Can someone help? Here is the entire code. [url]http://www.text-upload.com/read.php?id=138705&c=7070157[/url]
Sorry, you need to Log In to post a reply to this thread.