Um, huh? I mean this, basically:
for ( int i = 0; i < digit + 1; i++ )
std::cout<<'*';
std::cout<<'\n';
Um, huh? I mean this, basically:
for ( int i = 0; i < digit + 1; i++ )
std::cout<<'*';
std::cout<<'\n';
"Much better" is debatable, but you can make use of the constructor that takes an iterator range:
vector<double> V1(Model.begin() + StartModel, Model.begin() + EndModel);
Put another loop inside that loop. You want to print (digit+1) asterisks and then a newline.
>It's not really a logical falacy, it's a consequence of a -- completely possible -- set of events.
It's a logical fallacy because you've derived a hard conclusion based on the assumption that those events have already taken place. To remove the fallacy you have to prove that those assumptions are true, or alter your conclusion to allow for the alternative where those assumptions prove false.
>But not everybody who IS helpful IS flagged as an admin/moderator, if you follow me...
Indeed. My point of course was that I can't think of a way to measure the helpfulness of a member without some kind of intuition, experience, or inside knowledge.
>it would be interesing to see if one could see all rep points given and why.
You can view all of your previous rep, but others can only see your most recent five.
>sorry to pick on you Narue
When someone picks on me, I let it slide as the result of bad karma. ;)
>minimal effect on narue's rep because it's pretty big
>already and I don't have a huge reputation here.
I don't care what color the dot is, I just enjoy reading the comments. Rep with no comment or "n/a" is just boring.
>Aah but that is not as tangible is it Narue?
One could argue that the best things in life aren't tangible. But without getting into philosophy, there's no good way to measure how helpful a member is because such a measure relies on how active the member is as well as the quality of help the member provides.
For example, I could get the first reply on every thread with a completely wrong and unhelpful answer. Eventually someone would come around and give a correct answer, but if the thread is then marked as solved, my solved thread count would increase. This would boost my solved threads rank artificially because I didn't actually participate in solving the problem.
While these ranking measures are a nice curiosity, in the end they're completely worthless. Reputation can be abused, threads may not be marked solved or the measure can be abused, post count can be bumped drastically without helping... The only tangible measure I can think of (based on inside knowledge) is if the person is currently flagged as an admin or moderator, because they're virtually guaranteed to be helpful on the forums, if only by keeping them clean.
>Just because a EULA says something is illegal doesn't actually mean that it is...
No, it really is. Violation of the EULA constitutes violation of a license agreement, and a license agreement is a legally binding contract. Allow me to point out the logical fallacy in your argument.
1) An EULA can be overturned in court and,
2) An EULA cannot be enforced everywhere therefore,
3) Violation of an EULA is not illegal.
The error being the assumption that the EULA would be overturned in court or that all violators are in a location where the EULA cannot be enforced. The fact is that your two cases are exceptions rather than the rule, and if you remove the exceptions, your claim is silly. Violating an EULA is an illegal act that can be prosecuted however the creator wishes. This could be an actual lawsuit or it could simply be termination of services.
>I think that the 'real' law should stay well away from computer games.
Most software has license agreements, and violations of these agreements have been taken to court. I don't see how a video game license agreement is different from any other software.
[Note: It's extremely rude to post a message and then edit it into nothing. I've kept my reply the same as if you hadn't removed post #5's previous content]
>it s that i hav made some code
If you ask for generic help without posting code, everyone will assume you want freebies. Daniweb is about sharing knowledge, not giving away custom homework solutions.
>but its pretty long
Long is subjective. To me a few thousand lines isn't a big deal, but to many beginners any more than 50 is long. A few hundred lines isn't a problem, and if your game is longer than that, you've overcomplicated or over engineered the program.
>no one helps me but make fun of me
Welcome to the real world.
>they say try it yourself ,it will increase ur knowledge confidence and blah blah....
They're right.
>pls don't give me lectures as I am already under much pressure.....
We generally don't take kindly to people who wait until the last minute to do their projects and then come running to us with vague pleas for assistance. If you get a lecture, you probably deserved it.
>Is the solution simply to accept it as a char* instead of a const char*?
Hardly. It's better to understand the error and correct your logic rather than bumble your way through a workaround that will end up mysteriously crashing your program.
>I thought it was always better to have things const if you weren't going to modify them?
Not only is it better to use const when you aren't planning on modifying something, it's better to use const everywhere and only remove it when you absolutely have to. That guideline is much more of a pain to adhere to, but the const correctness you get from it is worth the effort.
>ok, so assuming I pass the function a const char*
Assuming you want to support passing string constants, your best bet is to convert to a string object and use the concatenation operator:
#include <string>
void MyFunc(const char* Filename)
{
cout << std::string ( Filename ) + ".tst" << endl;
}
>I'd need to convert it to a char* before I append anything.
No, because the pointer points to read-only memory. It really is const, so tossing away the const qualification is only going to move your error from compile-time to runtime. Your code is broken, and playing around with const isn't going to change that.
>thats broken to hell.
Ultimately, the only accurate measure is being a member for a few months and learning who has a good real[1] reputation.
[1] Real meaning not some vBulletin numbers game, but the honest respect of a significant majority.
>Thanks but this one doesn't work salem
"doesn't work" doesn't compute: ambiguous statement detected.
>a bot isn't necessarily bad.
I beg to differ. In MMOs bots encourage farming and can severely damage the game economy and balance.
>IMNSHO, there's no such thing as 'cheating' in a computer game.
Once again taking my experience from MMOs, bots are almost always in violation of the EULA as a form of cheating. Violating the EULA is an illegal act as well.
>It only really hurts yourself.
Perhaps if you're the only one playing the game and the results have zero effect on others. That's as silly as it is rare though; bots are generally used to improve one's standing in multiplayer games.
>...And of course he has waited to the last minute so he needs it asap
Well, that's his problem, not ours.
Note that these answers assume that by "game developer", you mean a programmer rather than a graphic designer or one of the many other roles involved in creating a game.
>1. What would best prepare me for making a video game?
Professional games tend to ride the edge of hardware technology, so you should be very familiar (not to mention up to date) with computer hardware, especially graphics hardware, and how to interface with it. In my experience, game programmers are among the more talented programmers, so you should also have a strong foundation in programming theory and practice as well as the drive to compete in the industry.
>2. How long have you been working with video game making and designing?
I don't work in the game industry, nor is it a hobby. My focus is on developer tools and compilers, but I've consulted for professional game projects in the past on back-end code.
>3. What program is used to make a video game on the computer? Programs?
No single program is used, but you can expect a good development IDE, usually a 3D or 2D graphics package and a sound manager.
>4. How many steps are there in making or designing a video game?
Pretty much the same steps as any other end user software.
>5. …
You need to add the appropriate DLL as a reference. You can do that from the UI by right clicking on your project and choosing "References". From there you can add a new reference for .NET. Alternatively you can reference the DLL directly from your code with a #using statement:
#using <mscorlib.dll>
using namespace System;
int main()
{
Console::WriteLine ( "Hello, world!" );
}
>I slacked off in class while my teacher was teaching us
At least you're honest. That won't stop most of us from letting you sit in the hole you dug for yourself, but it's a breath of fresh air nonetheless.
>How can i do it in C?
File handling examples for C are all over the place, but I'm guessing you didn't bother to search this forum. Here's yet another example:
#include <stdio.h>
int main ( void )
{
FILE *out = fopen ( "filename", "w" );
if ( out != NULL ) {
fprintf ( out, "Gold: 123" );
fclose ( out );
}
return 0;
}
>I went to c++ forum and saw it but fstream doesn't work on C.
Well, duh. C++ isn't C.
>2. Naruto
In my experience, people who have Naruto in their top 10 haven't seen many good anime. ;)
>3. Dragonball Z (if it counts)
It counts. I would say any anime that originated in Japan or any cartoon that has a noticeable anime influence (ex. Avatar or Code Lyoko) counts.
>can anyone tell me if global variables are not liked
Experienced programmers tend to cringe when they see global variables.
>and why
Global variables are almost always an indication of poor design. They're such a small and innocent seeming thing, but the repercussions can be truly frightening if you know what to look for.
A good analogy for global variables is throwing a stone into a pool of water. You throw the stone in the pool and it makes a little splash. Then there are ripples all the way to the edges of the pool. Then the stone wedges itself in a submerged gas vent that builds up pressure for several days and explodes spectacularly, causing untold pain and chaos. ;)
>Damn, not being visibly active really sucks. ;-)
The best moderators are the ones who are so subtle you never see them working. If I get noticed doing my mod/super mod duties, it means I was too heavy handed about it.
Yes.
>How about an EOF following the \n?
That won't happen either. When you press the Enter key, the buffered characters in the shell are sent to your program for processing. That means every character up to and including the newline represent a single input transaction. You can't add characters to the transaction after sending it in for processing, so the EOF signal would be a part of the next transaction, making it irrelevant to this transaction.
The two situations you've described won't happen in line-oriented interactive input, but they can happen if stdin is redirected to a file, which is why this isn't a complete solution. However, the "newline stuck in the input stream" problem doesn't seem to be as much of an issue when dealing with files. It's usually a matter of people not fully understanding how streams work and muxing up interactive input.
>What is the possible complete solution?
There isn't one. When more than one interpretation for a stream of characters exists, it's impossible to have a complete solution to any problem because for at least one interpretation, it won't even be a problem.
>What do you think of Akira ?
It's a cult classic, but I never figured out why.
>What about the second '\n'?
It doesn't exist. That loop is designed for line-oriented interactive input from stdin. Because a newline is expected to terminate the buffering mechanism for your shell, there will only ever be one newline, and that newline will mark the end of the buffer. As such, the loop isn't a complete solution, but it's close enough if you use it for the purpose it was designed.
IIRC, Dani doesn't allow popups, or flyins, or anything obtrusive in her agreements with advertisers. I'd suggest sending her a screenshot when you get it again, because the advertiser may be in breach of contract.
>I think you are perfect for the job.
Well, time has proven that at least the right people in high places agree with you, or I wouldn't be where I am today. ;)
>I'm gone.
Don't let the door hit you on the way out. I gave you the benefit of the doubt and offered a serious reply to your rant, but it's obvious at this point that you're simply trying to garner as much attention as possible due to some imagined insult. If you want to act like a child, I'll treat you like one.
>Does that happen often?
No, it doesn't happen often. I know that I asked without being approached, and jbennet made his preference very clear, which was a deciding factor in his consideration. I can't think of any others at the moment.
>I thought people were asked if they wanted to.
Becoming a moderator is by invitation only, but if you want the job it doesn't hurt to make yourself known to us. Otherwise I use nominations by trusted people, or I search for members that meet certain criteria and do a full background check from their Daniweb history.
>so we'll just have to believe that Narue asked for the position
Believe it, because I did. And it started quite the heated debate about whether I was suitable. Quite a good read, actually. I recommend it to anyone who gets access to the mod forum. ;)
At the risk of driving the thread even further off course, I'd like to address some of the issues raised concerning the moderators.
>For the very first post I made, a moderator insulted me by saying this is a "professional"
>forum and that I should capitalize sentences and use proper spelling and grammar.
The very fact that you consider it an insult suggests that you're not viewing the request objectively. I've been through the better part of your early posts and saw nothing about this, so I assume it was through a private message and thus, can't verify the "insult". However, we do ask that posts be made in full sentence English for the sake of professionalism. This is clearly stated in the community rules.
>the fact is that the moderators are under review because of my complaints
Moderators are always under review. It's my job to keep an eye on them and make sure that everything is running smoothly. Taking complaints into account is simply a variable in the constant "quality assurance".
>to the admins, who have been gracious and forthright from the beginning
Being gracious and forthright doesn't mean they'll actually do anything. Any complaints about a moderator will get redirected to me, and I'll ultimately handle them. As such, you'll get faster results by following the chain of command. Complaints about a regular member go to any of the moderators, complaints about a moderator go to the super moderator, and …
>1) a link to rules.
It's on every page, just below the breadcrumbs and page header along with the FAQ (which people also tend not to read) and the welcome guide.
>2) the name of a good moderator/other person who
>could give general help via private message
If you have a question that can be answered by posting in one of the forums, ask it in a thread. Moderators aren't obligated to give you private and personal help; in fact, most of us will refuse to do so when approached.
However, if you have a question directly related to a specific moderation action or our interpretation of the rules, any of us will be happy to answer through PM (though rule interpretation questions might be better suited to a thread on this forum so that everyone can see). If you have a question about the duties of a moderator, a request to become a moderator, or a complaint about any of the moderators, please direct your PM to me.
>If you were to agree to these terms, how would you expect
>the company to behave with regard to your material?
Given nothing other than your paraphrasing, I'd expect them to do anything they please except claim ownership of the material.
>Would you be angry if the company didn't get your permission?
Accepting the terms and conditions constitutes giving your permission for whatever they specify.
1) Sailor Moon (for sentimental reasons)
2) Haruhi Suzumiya no Yuutsu
3) Tenshi na Konamaiki
Moved.
>able to handle adobe photoshop and not slow down when u do other things
Photoshop is a resource hog. Keep that in mind. If you're going to be running Vista and Photoshop, I'd recommend at least 2GB of RAM.
>Have a webcam and burn cds with lightscribe...
You can buy these as USB or Firewire peripherals, probably for less than it would be built-in.
>heard alot of bad things about it that alot of programs wont run on vista
That's the case with any new OS. It's getting better by the day.
While I'm pleased that you diligently use code tags, please keep in mind that "icode" and "code" are two different tags that aren't designed for the same purpose. "code" tags should be used for blocks of code that are separate from the text of a post.
Code tags are separate
Usually have multiple lines
And preserve indentation
"icode" (aka. inline code) tags are meant for code that's embedded in the text
. These are usually parts of a single line of code, and possibly even a full line. Inline code tags do not allow multiple lines, and if you something in icode tags that should be in code tags, you will mess up the formatting, as the lack of indentation for the code in all of your posts for this thread shows.
I don't write games, so I can't help. But I do have a question. If you're a web designer, why would your company ask you to help write a game application?
>so it will take any number of character from 0 to max size until enter is not encountered
Well, scanf doesn't recognize a newline, so you'll have to use some other method. A generally good one is to signal EOF when you're done by typing Ctrl+Z (Windows) or Ctrl+D (Unix/Linux), then this works:
int a[100];
int i;
for ( i = 0; i < 100; i++ ) {
if ( scanf ( "%d", &a[i] ) == 0 )
break;
}
The text box control only recognizes the system newline, not the language newline, which could be different. Typically '\n' isn't actually multiple characters if the system uses something like CRLF. Instead, whenever '\n' is sent back to the system (through file I/O for example), it's expanded into CRLF.
Jx_Man gave the answer, but C# isn't only restricted to Windows. A more portable solution uses Environment.NewLine:
outputTextBox.Text ="\t\t .........." + Environment.NewLine;
Insertion sort is easy to write and works well with a stream of items.
>It is like saying that my religion is correct and yours is wrong.
If you believe in one religion, and I mean really believe, you usually can't believe in another without betraying your belief[1]. That kind of mutual exclusivity suggests that only one religion can be right. Sitting on the fence is for those who don't really believe and those who are simply trying to be tactful.
[1] Example: Christianity's very first commandment is "Do not have any other gods before me".
>Thank you all!
Don't confuse the desire to help with the desire to shut you up. Personally, I don't see you getting very far with programming if you can't work these kinds of things out even after being told exactly how to do it.
Wow, just wow. Here's the code you wanted, not that I think it'll help you any:
#include <iostream>
int main()
{
int value;
std::cout<<"Enter a number: ";
if ( std::cin>> value ) {
// The loop stops on 0, so
// treat it as a special case
if ( value == 0 )
std::cout<< value <<'\n';
else {
while ( value != 0 ) {
std::cout<< value % 10 <<'\n';
value /= 10;
}
}
}
}
>As in selecting which line to start from.?
Sure, but unless the file is structured enough to seek, you'll have to actually read your way to the correct line. Writing is harder if you mean to insert rather than overwrite. In that case you need to save the subsequent lines and shift them over like you would insert into an array.
>about how this could be achieved i meant solutions
I gave you two solutions. The code is trivial.
>for "number % base" would i change them to my variable names
If you want it to work. In particular, if I have an integer called value and I want the least significant base 10 digit, I would say value % 10
.
Why don't you actually try these things instead of look for existing code and expecting handouts? You'll learn a lot more that way.
[edit]
It's terribly rude to replace your post with something completely different after submitting it.
[/edit]
Here's a hint: What does fork do?
>wanted to know if it could be done
If you find yourself asking if "<insert something here> can be done in C++", just go ahead and assume the answer is yes. It probably is.
>Could you please show me how this could be achieved thanks.
How about I tell you and you try it out on your own?
Solution 1: Convert the number into a string and reverse the string.
Solution 2: Use number % base
to extract the least significant digit and print it until the number is 0. This method gives you the digits in reverse by default.
Conclusion: The word "God" makes people crazy around here.
Post the code that calls getRand.
How about you describe what you're trying to do? What you're asking for is somewhat nonsensical out of context.
>Can't we do anything about it?
Nope, not without punishing everyone else in the process. I take solace in the fact that out of a thousand idio^H^H^H^Hcareless beginners, one or two truly promising people make it through.
>Narue, you have been here for sometime I suppose, why so cynical?
Cynical and experienced are synonyms.
When you make a conversion like that, you get the digits in reverse. There are a number of ways to swap the order. First you have recursion:
#include <iostream>
#include <ostream>
void to_octal ( std::ostream& out, int value, int n = 0 )
{
if ( value == 0 ) {
if ( n == 0 )
out<< value;
return;
}
to_octal ( out, value / 8, n + 1 );
out<< value % 8;
}
int main()
{
to_octal ( std::cout, 26 );
std::cout<<'\n';
}
Another is converting each digit to a character and storing them in a string. You can either push them to the front of the string if that's a supported operation, or reverse the string at the end:
#include <iostream>
#include <string>
std::string to_octal ( int value )
{
if ( value == 0 )
return "0";
std::string result;
while ( value != 0 ) {
char digit = value % 8 + '0';
result = digit + result;
value /= 8;
}
return result;
}
int main()
{
std::cout<< to_octal ( 26 ) <<'\n';
}
#include <algorithm>
#include <iostream>
#include <string>
std::string to_octal ( int value )
{
if ( value == 0 )
return "0";
std::string result;
while ( value != 0 ) {
char digit = value % 8 + '0';
result += digit;
value /= 8;
}
std::reverse ( result.begin(), result.end() );
return result;
}
int main()
{
std::cout<< to_octal ( 26 ) <<'\n';
}
Or if you …
I'm impressed. You actually made it 5 posts before turning into a total d'bag. Most of your kind don't make it two posts, so I'd say you have some potential in being a normal, well adjusted member of society. With some effort, of course.