Welcome
Welcome to the forums of AntiRTFM's Absolute N00b Spoonfeed C++ Tutorials!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, <a href="/profile.php?mode=register">join our community today</a>!

Project ideas

Got an idea for a practice project / debug snippet / short-code contest / etc? Tell us about it here!

Postby Marss++ on Mon Jul 28, 2008 10:20 am

Looks good.


One suggestion to you nickybear.


From the looks of your code it seems to me that you have a lot of little drawings going on there. I must say that it would be alot easier for you get the base of the program down before you start creating all the little fun stuff.


Just a suggestion.


Good luck with that.
I'm a 15 year old kid who has his heart set on Programming.

Came here hoping to help so if you have any questions just ask!
Marss++
 
Posts: 149
Joined: Fri Jul 18, 2008 3:20 pm

Postby Doctor Salt on Mon Aug 04, 2008 5:34 pm

But lets not forget, unless you are taking a course for this, have assignments, homework etc, you are doing it out of your own motivation. Without that motivation, it gets boring and you stop, which is bad. Some times hard, long, coding can kill the fun of it.
Personally, i thrive in challenging myself, and i love the thrill of posting something and having someone say "Good job there chap!", which keeps me going. So while doing the fun stuff later is good for practicality/organization reasons, keep in mind the psychological aspect too.
Doctor Salt
 
Posts: 147
Joined: Wed Jul 30, 2008 3:32 pm

Postby Marss++ on Tue Aug 19, 2008 4:10 pm

Your right... Drawing is fun. I must admit I enjoy some good old fashion drawing when it comes to fun applications I make with C++.

So yes... Good point Salt. I was just trying to be a mom and tell him to get his work done! :)
I'm a 15 year old kid who has his heart set on Programming.

Came here hoping to help so if you have any questions just ask!
Marss++
 
Posts: 149
Joined: Fri Jul 18, 2008 3:20 pm

Re: Project ideas

Postby pipey85 on Sun Sep 13, 2009 6:05 pm

i agree with Doctor Salt, the challenege is what its all about, i ve never done anything with computers before, i dont go to college to study it, i motivate myself by the challenege, becaise i find it fun, even if it does get difficult sometimes.... any way i digress, i wrote this program recently and could be used for task number 2, i call it my cipher program :P enjoy.....

Code: Select all
#include <iostream>
#include <string>
#include <windows.h>
using namespace std;


string doCipher(string toChange, string key)
{
   int b = 0;
   
   for (unsigned int a = 0; a < toChange.length(); a++)
   {
      toChange[a] = toChange[a] ^ key[b];
      b++;
      if (b == (key.length()+1)) b = 0;
   }

   return toChange;
}


string returnCipher(string toReturn, string key)
{
int b = 0;
   
   for (unsigned int a = 0; a < toReturn.length(); a++)
   {
      toReturn[a] = toReturn[a] ^ key[b];
      b++;
      if (b == (key.length()+1)) b = 0;
   }

   return toReturn;
}
int main()
{
   string pass;
   string key;
   string returned;
   string backToNorm;
   
   cout << "Input the message you would like to code >> \n";
   getline(cin, pass);
   cout << "Now give a password to commence the cipher >> \n";
   cin >> key;
   
   returned = doCipher(pass, key);
   key = "changed";

   while(pass != backToNorm)
   {
      system("cls");
      cout << "the message has been encrypted, now you must enter the password >>\n";
      cin >> key;


      backToNorm = returnCipher(returned, key);


      cout << "\n\n\n" << backToNorm;
      if (pass != backToNorm) cout << "\n\n\nINCORRECT try again";
      Sleep (2000);
   }

   cout << "\n\n\nWell done you got it right!";


   char f;
   cin >> f;
   
   return 0;
}


comments are always welcome! :)
Pardon my n00bness, what I lack in C++ I make up for in time spent reading about C++ :P
pipey85
 
Posts: 40
Joined: Mon Jun 22, 2009 6:11 pm

Re: Project ideas

Postby noobgrammer on Sun Sep 13, 2009 8:23 pm

That's pretty cool you could implement that into a class maybe then use it in a game make your own backdoor to cheat or something.

I saw the caret < ^ > symbol in there I don't recall seeing that in c++ before what does it do.
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 176
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Project ideas

Postby pipey85 on Mon Sep 14, 2009 5:29 am

i read it in a book, its the exclusive or operator (aka XOR), the theory is that if some value say 'x' is XORed with 'y' then this value is XORed again with 'y' you will get the original value, its all to do with the binary i think...... in fact heres a link.... http://msdn.microsoft.com/en-us/beginner/cc305129.aspx

select chapter 7 and its on page 20... happy reading :)
Pardon my n00bness, what I lack in C++ I make up for in time spent reading about C++ :P
pipey85
 
Posts: 40
Joined: Mon Jun 22, 2009 6:11 pm

Re: Project ideas

Postby noobgrammer on Mon Sep 14, 2009 6:12 am

Thanks I've only glimpsed on that subject. I think it did something I've bin trying to figure out in C++ that I could only do in C.

I had stuck a cout after the word was scrambled and it showed me the symbols that I could only find using C's printf()
run that little code and you'll know what I'm talking about.
Code: Select all
#include <iostream>

int main()
{
   for (int i = 0; i < 256; i++)
   {
   printf ("%d\t %c  \n",i, i);
   }
}


I actually made a deck of cards using those symbols. now that I no the gotoxy() I might be able to make a card game

thanks for the link
I need a compiler with a can of RAID built into it

I added a msn messenger just for programming feel free to email or add yourself to it
User avatar
noobgrammer
 
Posts: 176
Joined: Tue Aug 25, 2009 10:44 am
Location: Orlando

Re: Project ideas

Postby pipey85 on Mon Sep 14, 2009 7:47 pm

those symbols are pretty cool, im not familiar with c though so i dont understand the syntax of printf, c++ is my first language and ive only been doing it for 2 months, can you not acquire those symbols using c++?
Pardon my n00bness, what I lack in C++ I make up for in time spent reading about C++ :P
pipey85
 
Posts: 40
Joined: Mon Jun 22, 2009 6:11 pm

Re: Project ideas

Postby C++ on Mon Sep 14, 2009 8:32 pm

noobgrammer wrote:Thanks I've only glimpsed on that subject. I think it did something I've bin trying to figure out in C++ that I could only do in C.

I had stuck a cout after the word was scrambled and it showed me the symbols that I could only find using C's printf()
run that little code and you'll know what I'm talking about.
I actually made a deck of cards using those symbols. now that I no the gotoxy() I might be able to make a card game

thanks for the link


Code: Select all
    #include <iostream>

    int main()
    {
       for (int i = 0; i < 256; i++)
            std::cout << i << '\t' << (char)i << '\n'; // You use a cast in C++ It's basically the same.
    }
New to C++ programming? Click here
C++
teh awesome
 
Posts: 217
Joined: Sun May 25, 2008 7:45 am

Re: Project ideas

Postby damsol on Mon Sep 14, 2009 9:18 pm

pipey85 wrote:those symbols are pretty cool, im not familiar with c though so i dont understand the syntax of printf, c++ is my first language and ive only been doing it for 2 months, can you not acquire those symbols using c++?


The function of printf in C is the same as cout in C++. I started off with C and I'm in the process of expanding my knowledge to C++ and a few others.

as an example:

C:
Code: Select all
printf("Hello World!");


C++:
Code: Select all
cout << "Hello World!";


Both of these would produce the exact same thing, printing Hello World! to the terminal.
damsol
 
Posts: 3
Joined: Sun Sep 13, 2009 2:20 am

Re: Project ideas

Postby pipey85 on Tue Sep 15, 2009 6:05 am

i understand that, but what i dont understand is the underlined part

printf ("%d\t %c \n",i, i);
Pardon my n00bness, what I lack in C++ I make up for in time spent reading about C++ :P
pipey85
 
Posts: 40
Joined: Mon Jun 22, 2009 6:11 pm

Re: Project ideas

Postby C++ on Tue Sep 15, 2009 6:14 am

pipey85 wrote:i understand that, but what i dont understand is the underlined part

printf ("%d\t %c \n",i, i);


%d = interpret i as a decimal (integer) value
%c = interpret i as a character

It basically tells printf to interpret the variable i differently. This can be done with a cast. Also see my example a few posts up.
New to C++ programming? Click here
C++
teh awesome
 
Posts: 217
Joined: Sun May 25, 2008 7:45 am

Re: Project ideas

Postby pipey85 on Tue Sep 15, 2009 7:18 am

that makes so much sense now, how did i not realise that. lol thanks c++ :)
Pardon my n00bness, what I lack in C++ I make up for in time spent reading about C++ :P
pipey85
 
Posts: 40
Joined: Mon Jun 22, 2009 6:11 pm

Previous

Return to -- Code Practice Submissions --

Who is online

Users browsing this forum: No registered users and 0 guests