You should check into object-oriented programming and design patterns if you haven't already done it yet. If you ever want to do that as a job, that's the next step.
You should check into object-oriented programming and design patterns if you haven't already done it yet. If you ever want to do that as a job, that's the next step.
Last edited by KFlint; 08-30-2011 at 03:14 AM.
that code u posted is 14years old hard ! I don't see the idea !
P.S.: silverlight owns
I wouldn't exactly call this the best place to get support or encouragement when starting out with very basic programming...
But I'll give one suggestion: since this is C++ you *really* should learn about the standard libraries, then rewrite this without C-style arrays and maybe even using a class or two (just for the hell of it).
[Edit: and yeah, design patterns...]
Last edited by Dion; 09-04-2011 at 08:23 AM.
If you want even more fun, watch a tutorial on designing app on mobile devices like Android phones or IPhone (I'd suggest Android because it's easier to get into object-oriented programming in Java).
Something like : Developing Android Applications with Java.
That's not that hard really, their API is relatively easy to understand.
Btw : while (quit == false) is redundant, you can just write while (!quit) as it's already a boolean.
Last edited by KFlint; 09-04-2011 at 01:04 PM. Reason: Automerged Doublepost
Yes, sometimes I wonder how they do pay off. If pirates are still willing to pre 99c apps how the fuck can they still succeed (mobile devs)? To me, the mobile market looks like a high turnover/low profit industry. Where by you spend all your time and effort into creating a game, selling it for 99c, and then hope that someone will buy it before someone cracks it and uploads it on the interwebz.
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music"
I agree on the game development on mobile devices being a low profit industry, I don't think there is much money to make unless you do a major hit. I read somewhere than the top 50 apps on Android make 90% of the money, in a sea of thousand apps, that's pretty discouraging.
A friend of mine coded a 3d puzzle game (it was a bit boring I believe) and made like 23$ in 4 months, not worth the time spent coding this, at all.
Still many companies want do develop utility apps for their clients for various purposes. That's an interesting field of programming.
The web is changing with the appearance of those mobile devices and both technologies will be even more intricate in the years to come, no matter what mobile devices will look like in 10 years, wheter the mobile device is in your hands, directly in a pair of glasses or whatever. Web backends, communication with web services and mobile interface, that's the future.
Anyway, there is more to it than selling games on the market place.
Hmmm, then why not something using them?
(Disclaimer: Code not compiled, tested, read after writing, or taken the least bit of care with...)
template<class T> T getresponse(std::string s)
{ // print s, then get and return the users response.
T t;
cout << s << std::endl;
cin >> t;
return t;
}
bool play() // returns true if play again
{
std::vector<int> array;
for (int i=0;i<100;++i)
array.push_back(rand()%1000+1);
std::sort(array.begin(),array.end());
cout << "Array has values from "<<array.front()<<" to "<<array.back() << std::endl;
int guess;
while ( guess=getresponse<int>("Enter guess (or 0 to exit): "))
{ // user didn't type 0.
if (find(array.begin(),array.end(),guess)!=array.end())
{ // found guess in the array.
cout <<"You got it OlegL!" << std::endl;
break;
}
cout << "Nope." << std::endl;
}
char answer = 'z';
while (answer!='y' && answer!='n')
answer = getresponse<char>("Play again? [y/n]: ");
return (answer=='y');
}
int main()
{
srand( time( 0 ) );
while (play()) ;
cout << "Bye."<<std::endl;
}
Bookmarks