Monday, March 17, 2008

It's back to Flash

Max and I have gotten back into working with Flash, since that seems to be a common interest with the both of us. It seems now, after working with C++ and JAVA that coding ActionScript will be easier. We've already worked out a few problems that came up. One was with a "quit" function and the other was a string problem. First of all here is the "quit" function:

on(release){
fscommand("quit");
}

The problem we were having was that you need to run the program as an SWF file. You cannot run the program in Flash. The other problem was just that Max didn't add in a +. When you code for inserting strings into text, you need "Your Text " + isherestring, or something of the sort. It's a lot like JAVA.

Overall... It looks promising.

Thursday, March 13, 2008

C++ get's an F--

I got Microsoft Visual C++, and am so far throughly confused. I guess it will be like NetBeans all over again. I need to find some easy to use instructions on how to actually use VC++. I tried writing a few simple things, but none of them would build correctly.


Confusion is not fun.

Wednesday, March 12, 2008

First Day Back

It's the first day back from a two week vacation (in which I attempted to learn Java) and I'm already having problems. I suppose I should start out this blog entry by explaining what I did before vacation started, since it appears that I did not write something then.
From what I can remember, and looking back at the program I made, I was working with strings. Since I used strings in Java, I can now compare methods. The one difference is that the program I used, NetBeans, has a visual component that Dev C++ does not have. In making the GUI, the program can define variables for you, whereas in Dev you have to define them. It isn't all that hard, however:

int main()
{
char firstname[50];


That's it. Then you can apply it to the program:


cout<<"Please enter your first name: ";
cin.getline ( firstname, 50 );


This was a fairly successful program. It isn't all that special, but it works the way I want it to, which is the important thing.

Now on to todays doings. I tried to download Microsoft Visual C++ because Max said that it was better and had more tutorials. In conclusion, nothing worked. It stopped responding before anything could even start responding. I'm going to try at home, since it might be something at school. If that doesn't work, Max has a disc with it on it.
While looking for VisualC++, I stumbled upon what's called DarkGDK, which essentially is a game creator/visual graphics additive for VisualC++. That, I believe, would be worth looking into. Even if we don't make any actual games, making an environment would be awesome.

More on this tomorrow.

Wednesday, February 20, 2008

[Blogs][Week]

Because of lack of time and lack of class, this blog will cover last Monday (the 11th) to today.
Monday:
Monday was not a very exciting double, considering all I was doing was trying to figure out what pointers did, how structures worked, and started working on arrays. I moved on from pointers unsuccessfully. I realize what they do, just not how they work. The tutorial was not very helpful, for it was more of a complicated example than an actual tutorial. So I moved on to structures, which made a bit more sense. Structures are used mostly for database programs, as it would seem.

int main()
{
database employee;

employee.age = 22;
employee.id_number = 543927;
employee.salary = 12000.21;


Structures and pointers are probably not going to play a big part in our project for now, unless someone flies out of the sky and explains it to me in layman terms.

With that, I moved on to arrays. An array is basically a matrix, but not quite. A more correct wording is that a matrix is an array. After writing out the tutorial and seeing that it worked, I decided to mess around with the numbers a bit. The double was over by now, and due to school holidays and snow days, I didn't have class until Friday, which was a short class.

Today
Today I messed around with the arrays some more. Essentially, I was just doing the same thing. Here is the code:

#include

using namespace std;

int main()
{
int x;
int y;
int array[50][50];


for ( x = 0; x < 50; x++ ) {
for ( y = 0; y < 50; y++ )
array[x][y] = x + y;
}
cout<<"Array Indices:\n";
for ( x = 0; x < 50; x++ ) {
for ( y = 0; y < 50; y++ )
cout<<" "<< array[x][y] <<" ";
cout<<"\n";
}
cin.get();
system("\n pause");
}



It makes a 50 x 50 array of x + y.
That's it for now.

Friday, February 8, 2008

*Blogpost

I started out the class period trying to fix my simple switch program. I was, for the most part, unsuccessful, though I did come up with a momentary explanation. The problem is that the message displayed doesn't appear on the screen after the case is activated, with the exception of a few times. What I think is going on is that the program has already registered the message from previous attempts so the time it takes to display and the time it takes to close the program is so small that the message doesn't appear. Whenever I change the code, the message comes up for a brief moment, then the program closes. That is the other problem, I can't seem to get the program to pause, but that's the least of my worries right now.
I moved on to pointers for the sake of keeping up with Max. Basically, I know what pointers are and how they work, but I don't know how to use them in an actual program. This seems to happen a lot. I understand what the code does, but I can't get it to function properly. I must say it is a pain.

Wednesday, February 6, 2008

Case 6: Blogging

Because I ran out of time to post a blog on Monday, and there was a snow day on Tuesday, and today was a school holiday, I will be posting today as if it were Monday.

I moved on to switch cases, and I found that they are easier than they sounded. For lack of a better example, they are like program menus. Here is a chunk of code:

switch ( input ) {
case 1:
cout<<"You chose 1.";
break;
case 2:
cout<<"You chose 2.";
break;
case 3:
cout<<"You chose 3.";
break;
case 4:
cout<<"You chose 4.";
break;
default:
cout<<"Why can't you follow directions?";
break;
}
What happens is you enter a number between 1-4 and whatever one you choose, it will run that case. If you pick something other than that, it will display a default message. Currently, I've gotten the cases to work, but the default doesn't work. Another problem is that the message (ie. You chose 4) doesn't stay. It quickly displays and then the window closes. That should be easily solved, but I didn't have time to solve it because...
The second half of the double period was a presentation of Zhanar's Sudoku Solver. We proved that, when solving a sudoku, I am smarter than a computer. That might be an incentive for her to make a logical Sudoku Solver, for the way that her current program works doesn't use logic. We went through the code and Zhanar explained what everything did. I didn't necessarily understand what all the code did, but I was able to understand the basic functions of each bit when explained. It was a good presentation.

Friday, February 1, 2008

Functions!!

These past two days I've been working with functions. Actually, I haven't done all that much. Yesterday (Thursday) was not a very productive day. The extent of my learning was reading about functions on the C++ Tutorial site. Due to many distractions, I never got to the coding part. Today, however, I did. It was as easy as I figured it to be. My only problems were human error (forgetting an int main() and a few ;'s. I actually solved a problem on my own, but it turned out to be my own fault again. I forgot to add cin.get(); at the end. Here is the code:


#include

using namespace std;

int mult ( int x, int y );
int main()
{
int x;
int y;

cout<<"Please input two numbers to be multiplied: ";
cin>> x >> y;
cin.ignore();
cout<<"The product of your two numbers is "<< mult ( x , y ) <<".\n";
cin.get();
}

int mult (int x, int y )
{
return ( x * y );
}

This program, which is an example from the tutorial, asks you for two numbers and multiplies them. A very basic example of functions.

I still have more to work on with the functions. The more advanced functions will be tougher and, judging by what's ahead of me in the tutorials, I might want to spend more time with the simpler things and make sure I have them down.