LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

  • (3 Pages)
  • +
  • 1
  • 2
  • 3

35 Replies - 4362 Views - Last Post: 03 November 2010 - 05:42 AM

#1 Dark_Necros   User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 253
  • Joined: 29-May 09

LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 14 January 2010 - 08:25 AM

you probably get a million of these a day, but... I JUST WROTE MY FIRST PROGRAM!!! not the ones that come in a tutorial... i built this one from the ground up. oh well lol.
Is This A Good Question/Topic? 0
  • +

Replies To: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

#2 FrozenSnake   User is offline

  • En man från Sverige!

Reputation: 123
  • View blog
  • Posts: 1,033
  • Joined: 30-July 08

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 14 January 2010 - 08:30 AM

View PostDark_Necros, on 14 Jan, 2010 - 03:25 PM, said:

you probably get a million of these a day, but... I JUST WROTE MY FIRST PROGRAM!!! not the ones that come in a tutorial... i built this one from the ground up. oh well lol.


What type of program did you wrote?
My first program was

#include <iostream>
int main()
{
	std::cout << "Hello World";
	std::cin.get();
	return 0;
}
Yes it's a program! :P
Was This Post Helpful? 1
  • +
  • -

#3 KYA   User is offline

  • Wubba lubba dub dub!
  • member icon

Reputation: 3212
  • View blog
  • Posts: 19,240
  • Joined: 14-September 07

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 14 January 2010 - 08:31 AM

Congratulations! That is an important step. I'm not entirely sure where this should go, as it isn't directly related to C++. I think Student Campus.

*Moved*
Was This Post Helpful? 0
  • +
  • -

#4 Dark_Necros   User is offline

  • D.I.C Regular

Reputation: -7
  • View blog
  • Posts: 253
  • Joined: 29-May 09

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 14 January 2010 - 12:43 PM

well, the program was a multiplication program. you enter a number, then it says "this was the value you entered." then it would ask for another value. then it would say again "this is the value you entered" then it would say "the product of the two numbers you entered is #"


the reason i posted it in the c/cpp forum is that the program was cpp lol.
Was This Post Helpful? 0
  • +
  • -

#5 optix212   User is offline

  • D.I.C Addict
  • member icon

Reputation: 30
  • View blog
  • Posts: 540
  • Joined: 10-October 09

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 14 January 2010 - 12:53 PM

congratulations! this is your first step into becoming a fell fledged programmer!

It may not seem like a big step now, but looking back, the first programs i ever made were probably the most important in my learning experience.

Now you should try and make your program into a full fledged calculator. If you can implement multiplication, try addition, subtraction, and maybe even the powers function. This will get you used to assignment operators, and also if-else statements, or the switch case (which is what i used when i made my first calculator).

To tell you the truth, lots of people start off making calculators, and it is a really, really good place to start, as math is essential in programming!

Good luck, and happy programming!!
Was This Post Helpful? 0
  • +
  • -

#6 nanowire   User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 107
  • Joined: 05-January 10

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 14 January 2010 - 02:49 PM

I think that this should be moved to somewhere else, not in the student campus. Just not here.

Besides, making your own program is easy, and mine was one which converted Celsius to Fahrenheit.
Was This Post Helpful? 0
  • +
  • -

#7 optix212   User is offline

  • D.I.C Addict
  • member icon

Reputation: 30
  • View blog
  • Posts: 540
  • Joined: 10-October 09

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 14 January 2010 - 07:02 PM

Nano, don't put the guy down, thats just mean. Celsius to Fahrenheit isn't much of an accomplishment either by the way...
Was This Post Helpful? 0
  • +
  • -

#8 xclite   User is online

  • I wrote you an code
  • member icon


Reputation: 1481
  • View blog
  • Posts: 4,343
  • Joined: 12-May 09

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 14 January 2010 - 07:53 PM

Mine was lame as crap:
5 CLS
10 PRINT "HELLO WORLD"
20 END


Was This Post Helpful? 0
  • +
  • -

#9 Dogstopper   User is offline

  • The Ninjaducky
  • member icon

Reputation: 2972
  • View blog
  • Posts: 11,223
  • Joined: 15-July 08

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 14 January 2010 - 07:57 PM

Mine looked like this:
#include "iostream.h>
using spacename std;

main() 
{
	cout << "Hello World";
	return 0;
}



Then I got frustrated because it wouldn't run...hmmm, I wonder why...
Was This Post Helpful? 0
  • +
  • -

#10 Liontrue1   User is offline

  • D.I.C Addict
  • member icon

Reputation: 48
  • View blog
  • Posts: 811
  • Joined: 20-May 06

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 15 January 2010 - 01:53 AM

I always found C++ sucky... The error messages are unreadable.. However, writing your first program is a good step :)

@DogStopper: #include <iostream>
Was This Post Helpful? 0
  • +
  • -

#11 SwiftStriker00   User is offline

  • No idea why my code works
  • member icon

Reputation: 439
  • View blog
  • Posts: 1,617
  • Joined: 25-December 08

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 15 January 2010 - 07:28 AM

lol @ Dogstopper and grats dark necros. My frist program was crazy.
public class HiWorld{
 public static void main( String args[]){
	 System.out.println("Goodbye World");
	 System.out.println("Bet you didnt see that coming");
 }
}


Was This Post Helpful? 0
  • +
  • -

#12 derrick1123   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 09-March 08

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 15 January 2010 - 07:54 AM

My first code in C++ (and I've only ever coded in php) was a square root thingy. :P
// Derrick Alvarado
// Jan 15, 2010
// - Random Shit -
# include <iostream>
using namespace std;

int final;
int num1;
int x;

int sqrt(int);
int main()
{
	cout <<endl<<endl<< "Enter number to be squared: ";
	cin >> num1;
	final = sqrt(num1);
	cout << "The square root of "<<num1<<" is "<<final << endl;
}

int sqrt(int x1)
{
	int done;
	done = x1*x1;
	return done;
}



Took me a min to search on the web on how to get the second function to work like I wanted it to, but I'm happy with it. :)
Was This Post Helpful? 0
  • +
  • -

#13 anonymouscodder   User is offline

  • member icon

Reputation: 126
  • View blog
  • Posts: 710
  • Joined: 01-January 10

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 15 January 2010 - 08:44 AM

Congratulations, keep it up :)
Was This Post Helpful? 0
  • +
  • -

#14 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 15 January 2010 - 10:46 AM

I still remember my first programs... they went like this:
My Very first program:
10 CLS
20 PRINT "HELLO NICKDMAX"

RUN


Then I filled the screen with my name
10 CLS
20 PRINT "HELLO NICKDMAX",
30 GOTO 20

RUN


Kind of made it blink
10 CLS
20 PRINT "HELLO NICKDMAX"
30 GOTO 10

RUN


Added a delay:
10 CLS
20 PRINT "HELLO NICKDMAX"
25 FOR X = 1 TO 1000
27 NEXT
30 GOTO 10

RUN


10 CLS
20 FOR X = 1 TO 100
30 PRINT TAB(X) "NICKDMAX";
40 NEXT


Eventually I ended up with something like this:
10 CLS
20 FOR X = 1 TO 100
30 PRINT TAB(20+ 20 * SIN(X/50)) "NICDMAX";
40 NEXT


Which printed my name like this:

Quote

............................</Dream.In.Code>
...................................</Dream.In.Code>
.......................................</Dream.In.Code>
........................................</Dream.In.Code>
.......................................</Dream.In.Code>
..................................</Dream.In.Code>
...........................</Dream.In.Code>
...................</Dream.In.Code>
............</Dream.In.Code>
.....</Dream.In.Code>
.</Dream.In.Code>
.</Dream.In.Code>
...</Dream.In.Code>
........</Dream.In.Code>
...............</Dream.In.Code>
.......................</Dream.In.Code>
..............................</Dream.In.Code>
....................................</Dream.In.Code>
........................................</Dream.In.Code>
........................................</Dream.In.Code>
......................................</Dream.In.Code>
................................</Dream.In.Code>
.........................</Dream.In.Code>
.................</Dream.In.Code>
..........</Dream.In.Code>
....</Dream.In.Code>
.</Dream.In.Code>
.</Dream.In.Code>
....</Dream.In.Code>
..........</Dream.In.Code>
.................</Dream.In.Code>
.........................</Dream.In.Code>
................................</Dream.In.Code>
......................................</Dream.In.Code>
........................................</Dream.In.Code>
........................................</Dream.In.Code>
....................................</Dream.In.Code>
..............................</Dream.In.Code>
.......................</Dream.In.Code>
...............</Dream.In.Code>
........</Dream.In.Code>
...</Dream.In.Code>
.</Dream.In.Code>
..</Dream.In.Code>
.....</Dream.In.Code>
............</Dream.In.Code>
....................</Dream.In.Code>
...........................</Dream.In.Code>
..................................</Dream.In.Code>


Though the above was created via python:
import math
prefix = "[color=white]"
suffix = "[/color]"
for i in range (1, 50):
	spaces = "".rjust(int(21+20*math.sin(i/2.5)),'.')
	message = prefix+spaces+suffix+"</Dream.In.Code>"
	print message


Was This Post Helpful? 2
  • +
  • -

#15 skyhawk133   User is offline

  • Head DIC Head
  • member icon

Reputation: 1972
  • View blog
  • Posts: 20,426
  • Joined: 17-March 01

Re: LOL! THE FIRST PROGRAM THAT I WROTE MYSELF!

Posted 15 January 2010 - 10:48 AM

Hahaha, that's awesome Nick.
Was This Post Helpful? 0
  • +
  • -

  • (3 Pages)
  • +
  • 1
  • 2
  • 3