Quantcast

Jump to content

» «
Photo

Learning programming from scratch

8 replies to this topic
Happyness
  • Happyness

    Li'l G Loc

  • BUSTED!
  • Joined: 11 Jan 2013

#1

Posted 23 June 2013 - 04:10 PM

Hello folks. I will hopefully finish high school this summer (granted I don't fail at a subject, because then I need to wait a few months before having another try), and I am aspiring to study computer science at university, now before university starts I got plenty of time, and I want to fill the holes in my free time with programming.

I got no idea about programming whatsoever, just what languages are there, what languages are being used to make games on iOS / Android / Consoles ....

Is there a place where I can learn from scratch so I could get a basic idea at least about programming and whatnot before my university starts this year?

I appreciate your help, also, if you're willing to help me personally and whatnot, I might make small donations in future if you turn out to be a real help. icon14.gif

Thanks in advance folks, you're cool.

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#2

Posted 23 June 2013 - 05:58 PM

You have to learn C++. Hopefully, your Uni program will start with courses in C++. To prepare for that, start learning C. There is absolutely zero reason for you to start with anything else if you are serious about becoming a game dev.

Later, you might need to pick up some C# or Java, depending on which platform(s) you end up working with, but that's relatively easy to do once you know C++. Both of these languages have syntax based on C++, so switching over is easy. The biggest difference is that C# and Java are byte-compiled and require a virtual machine to run on. (CLR and JVM respectively.) This has advantages and disadvantages which you'll need to learn to work with. But there is lots and lots of fundamentals you have to learn before you get to that, and C/C++ is a good platform to learn. Besides, if you end up working on a AAA project on a console or PC, you'll be using C++. So it's good to know.

Happyness
  • Happyness

    Li'l G Loc

  • BUSTED!
  • Joined: 11 Jan 2013

#3

Posted 23 June 2013 - 06:38 PM

Thanks for the input, appreciated and great tips.

But any websites where I can start learning C? from scratch, I wish I had this passion when i was a kid.

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#4

Posted 23 June 2013 - 07:20 PM

You can start learning the basics with Learn-C. The nice thing about the site is that they run an interactive shell which lets you run small snippets of C code right there on their site. It's good to get you started without having to learn how to compile the code, all the details of what the compiler does, and so on.

That said, at some point, you need to learn how to use a proper compiler and how to organize your code into multiple source and header files. I would recommend learning to work with gcc compiler at some point. It's a standard compiler for Linux, but you can also get a Windows version via MinGW project. There is quite a bit of a learning curve there, though. Ideally, you might want somebody to show you how to work with it.

If you are on Windows, you might also want to take a look at Visual C++. It's part of Visual Studio, and you can get the Express edition for free. There are many tutorials on-line, including some Youtube videos, that will walk you through setting up a project under Visual C++.

As the name suggests, it's a C++ compiler, but almost any C code will compile just fine under C++. So you don't need to worry about the differences until you start doing actual C++ stuff.

Happyness
  • Happyness

    Li'l G Loc

  • BUSTED!
  • Joined: 11 Jan 2013

#5

Posted 23 June 2013 - 07:29 PM

icon14.gif Very much appreciated. cookie.gif , the thing is, where I live, people are oblivious with these technologies and whatnot, so yeah...

How about that 'thenewboston" or whatever his name is? Has around 200 videos on how to program in Android. Do you think he'd benefit me well?
Also, I am running Windows, never tried Linux. Will bookmark this thread and look into it on 7/7 when I finish my school, but until then, more and more tips are really appreciated.

Thanks K^2, really appreciated. icon14.gif

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#6

Posted 23 June 2013 - 08:52 PM

Programming is one of these fields where there is no one fixed way you should be learning things. There are skills you can pick up working with any language on any platform. There are skills you can only pick up working with many different languages and platforms. And there are skills for a specific language or a specific platform you'll only get by investing a lot of time into that language or platform. And when you'll be working on a major project, you'll need all of these. Since you are just starting out, it doesn't matter too much what you do, so long as you do something. Any skills you can pick up are going to be useful.

The only reason I'm recommending starting with C is that it is the fastest way you'll get to most of these skills. It's not the fastest way for you to start actually making games, by the way. It's one of the thornier paths, but it's also the one that will get you the furthest.

It doesn't mean that you can't also experiment with other things in parallel. Small projects for Android can get you to making some very simple games in shorter time. And it's not a bad skill to have. If you see a good resource to learn from, definitely go for it. Everything you learn with C will help you make Android projects, and everything you make for Android will help you better understand why you are learning certain things in C.

Other options include making browser-based games. You can either try your hand at making flash games. That can be done by either getting the Adobe Flash or by using some 3rd party tools, like Haxe. Or you can even make games that run on the browser directly, using HTML5 and JavaScript. In either of these cases, you'll be working with a scripting language derived from ECMA Script. It is yet another language that uses C-like syntax, so again, you'll see many parallels in how things work.

So you have options, and you should see what interests you the most. But try to keep up with fundamentals as well, and C is really the best language for learning these.

Happyness
  • Happyness

    Li'l G Loc

  • BUSTED!
  • Joined: 11 Jan 2013

#7

Posted 24 June 2013 - 04:13 AM

Thanks for your contribution, I liked it a lot and definitely made me even more interested in learning programming. Cheers.

deathdealer
  • deathdealer

    soon to be dead

  • Members
  • Joined: 25 Feb 2007
  • None

#8

Posted 14 September 2013 - 10:59 PM

hello,

 

I'm making a java program that let's you find the area and perimeter of a square, rectangle, and a circle with the fourth choice being the option of quiting the program. here's what i have for the main:

 

 

 

public static void main(String[] args) {
  // TODO Auto-generated method stub
       
  //char answer for 0,1,2, and 3
  String answer = "0"+ "1" + "2" +"3";
  String input = new String(" ");
  input = JOptionPane.showInputDialog( "0:square "+"1:rectangle " + "2:circle " + "3:quit ");
  answer = input; 
  
  
  
  //while answer = 0
  
  
   while(answer.equals("0")) {
   getsq();
   calcsq();
   dispsq();
   input = JOptionPane.showInputDialog("0:square "+"1:rectangle " + "2:circle " + "3:quit ");
      answer = input;
   
   
  }
  
  
  //while answer = 1
  while(answer.equals("1")) {
   getrec();
   calcrec();
   disprec();
   input = JOptionPane.showInputDialog("0:square "+"1:rectangle " + "2:circle " + "3:quit ");
      answer = input;
  }
  
  
  //while answer = 2
  
  while(answer.equals("2")) {
   getcircle();
   calccircle();
   dispcircle();
   input = JOptionPane.showInputDialog("0:square "+"1:rectangle " + "2:circle " + "3:quit ");
      answer = input;
  }
  
  //while answer = 3
  
  if(answer.equals("3")) {
   JOptionPane.showMessageDialog(null,"goodbye!");
  }
  }// end main

 

 

 

here's the problem. I'm trying to make the user input valid choices and if they make invalid choices then they'll have to choose again. I've tried if(answer >3) but that didn't work and I tried if(answer.equals(>"3") but I get an error on that as well. any suggestions or hints? thanks in advance!


Rawra
  • Rawra

    Daedric Prince of Madness

  • Members
  • Joined: 06 Aug 2007

#9

Posted 15 September 2013 - 10:47 PM Edited by Rawra, 16 September 2013 - 07:33 PM.

@deathdealer: I haven't done Java so I don't know if what I am saying is gibberish or not

 

Firstly, would it not be better to write it like this:
 

while(answer < "3")
{//take anything from 0, 1, 2. Anything higher can be treated as a request to quit
	if(answer == "0")
	{//chose number 0
	
	}
	else if(answer == "1")
	{//chose number 1

	}
	else
	{//chose number 2

	}

	//now we grab the input again
}

//we broke out of the loop and so we must wish to quit

If I read it right, you are checking for input for the value "0", now lets assume it does it. Now it will KEEP looping unless it isnt equal to 0 anymore. Now it will NEVER react to user input 0 as the looping is all wrong.

String answer = "0"+ "1" + "2" +"3";

What is this? Will this result in 'answer' being "0123" or something?

 

 

Here is an example of how I would do it. It is in C, but hopefully the same method applies.

void main()
{
	int answer;

	printf("0:square 1:rectangle 2:circle 3:quit\n");
	printf("Input: ");
	scanf("%i",&answer); //grab their input

	while(answer < 3)
	{
		switch(answer)
		{
		case 0: //square
			getsq();
			calcsq();
			dispsq();
			printf("Calculate a square\n");
			break;
		case 1: //rectangle
			getrec();
			calcrec();
			disprec();
			printf("Calculate a rectangle\n");
			break;
		case 2: //circle
			getcircle();
			calccircle();
			dispcircle();
			printf("Calculate a circle\n");
			break;
		}

		printf("\n0:square 1:rectangle 2:circle 3:quit\n");
		printf("Input: ");
		scanf("%i",&answer); //grab user input again
	}
        //we got here, which means the input was 3 or more
        //so lets quit
	printf("Goodbye!\n");
	
}

On a side-note, the 'answer' variable in yours seems completely redundant as it could surely be done with just 'input' ?

 

EDIT:::
I just re-read your post and see you wish for it to take ONLY 0,1,2,3 and to loop around again if its anything else. In this case, you could replace

while(answer < 3)

with

while(answer != 3)

so that anything other than 3 keeps looping, so that only 3 = quit





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users