Get Some

General => Technology & Hardware => Topic started by: Kayne on November 20, 2010, 06:33:34 pm

Title: Good programming language to learn?
Post by: Kayne on November 20, 2010, 06:33:34 pm
I learnt Visual Basic in the second half of this year, When I tried making games though, I found it pretty limiting, (i.e I couldn't have more than 2 buttons being pressed without one interupting the other)

I did make a pokemon battle game, however, :P

That was at school aswell, So I didn't get much chances to really get into it.
But, After it I've found that I like programming :>

I want to get into a programming language that is very useful / all rounder, Idk.. Wouldn't mind being able to write code for source game mapping? :P


In short.

Suggest a good program language that is widely used, and can be used for making games.

Don't worry about it being "easy"... I'm sure I'll manage lol.

And if you can, (be f**ked), Link tutorials/programs that you think would be helpful / Helped you :>
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 06:36:44 pm
C
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 06:38:27 pm
Quote from: Pyromanik;1333704
C.

Is C different to C++?

Or is one just a more advanced form, I.e Know one, pretty much know the other?
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 06:38:31 pm
Well, to be less of a cunt, most games engines are programmed in C++, with extensive use of python or lua scripting to create all the game mechanics, etc.


And yes, C is different to C++

C++ is an incrementation of the C language which adds all sorts of nifty tricks like object orientation.
I had a lecurer who used to say "C isn't much more than a structured assembly language."
It's generally used for speed, etc, which is reasonably critical in high power games (and embedded devices, etc).

Smaller stuff is usually coded in whatever, java on phones and net apps, etc. Flash/Actionscript is also pretty popular.
Microsoft's C# is coming more into the mix these days, due to the dramatic rise in popularity of the DirectX renderer, and then the XNA game dev studio libraries on top of that.
Spacemonkey has a lot of experience with XNA. I've never used a microsoft specific framework.
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 06:42:45 pm
You still recommend to learn C though, or at least learn C first?
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 06:44:32 pm
I think C is a fantastic language, but it's not a nice place to start.
Having said that, I started with C++, though I wasn't teaching myself by the time I got any decent with it.

Your best bet is really to learn something like Python.
There are plenty of open source engine projects that utilise it to create games.
Or lua.

C will force you to learn all sorts of shit about memory management on top of the language, because if you don't you're fucked.

I say start small and ramp up. You can learn a tonne of shit at uni or tech about how the more difficult stuff works. But using something like Python and running with an existing project will get you a shoe in.


Again, having said this, I've touched neither python or lua, because I'm a dick.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 06:54:16 pm
Quote from: `Kayne;1333708
You still recommend to learn C though, or at least learn C first?

Oh, but again, to directly answer this question: C++ is similar to C, but not the same. To go from C++ to C, you need to forget some stuff, and learn new (more oldschool) ways of doing things. Subtle differences.

Not difficult though. Know one, you can use the other for basic stuff no problem once you learn to printf() instead of cout <<
Title: Re: Good programming language to learn?
Post by: Catalyst on November 20, 2010, 07:14:28 pm
start with something easy like python
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 07:14:47 pm
cool Cheers,

I've downloaded Phython and am currently printing stuff :D
Title: Re: Good programming language to learn?
Post by: Greaver on November 20, 2010, 07:28:01 pm
I'm just learning VB at the moment, nice and easy, my programming mates recommend learning C++ first then C but I suppose if you want to jump in the deep end.

Memory management seems far too involved for me, I don't want to take programming that far, just to able to use it as a resource to create handy apps for arduous tasks.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 07:35:44 pm
C at the basic end (read: beginning to learn) is no more complex than C++.
But learning C++ will teach you object oriented design.
But Java will probably do a better job of that.

Depends on the person doing the job, and the job they're doing.

For example: Sounds like you might be better off using shell scripting Greaver.
But then I hear .bat files can be a cunt. BASH ftw. Again I'd probably use Python, if I knew it.
Title: Re: Good programming language to learn?
Post by: Bell on November 20, 2010, 07:37:08 pm
I'd start with a script like lua or python to get some shit working quickly and easily.
Getting a basic grasp of scripting will allow you to fool around with modding etc.
Then move to C# if you want to take it further and learn OO and current programming practices.
Then I'd do a little bit of C++ if you want to be a professional programmer.

Realistically you could stay with C# since the largest proportion of programmer jobs are C# but I think all programmers should have some grasp of memory management and C++ is good for getting to grips with that.

Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 07:40:16 pm
I love C for what it teaches (and inadvertently enforces). Helps so much when using a higher level language IMO.
God I miss proper hacking.
Title: Re: Good programming language to learn?
Post by: Greaver on November 20, 2010, 07:44:16 pm
Quote from: Pyromanik;1333741

For example: Sounds like you might be better off using shell scripting Greaver.
But then I hear .bat files can be a cunt. BASH ftw. Again I'd probably use Python, if I knew it.

Aww yeah I will take that into consideration, cheers
Title: Re: Good programming language to learn?
Post by: toofast on November 20, 2010, 07:51:29 pm
c#. Personally i find it a lot easier and simpler that c/c++ to use. Plus as a noob, its not hard to learn c#, since msdn have a great help database.

Plus with c#, you can go visual c#, and have a gui(form) going in seconds.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 07:52:24 pm
That's what QT is for ;)
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 20, 2010, 08:16:58 pm
What kind of Visual Basic did you do? Visual Basic .Net, or old Visual Basic 6?

If you did .Net, C# would be a good direction to go it as it's the same .net framework.


C# - ASP.NET for jobs

C# - XNA for hobby game development on Windows/xbox

php for web stuff

C++ for (professional Game Development) {}


SQL if you're boring and have no life (no offence to sql people)


If you still have your email account from your uni, you might be able to go to dreamspark and download the full version of visual studio.
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 08:24:23 pm
Visual Basic 6 sounds the most familiar.

By the looks of Python, I'm not quite sure if i'll be happy with using it.

I enjoyed the fact that I could see what I was doing with Visual basic. As in, If i wanted something to be somewhere, I could just click drag it there. If I wanted to move it i'ld just input co ordinates.

Python is looking to be just trial and error atm, Unless there is some better interface than a (dos like) box
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 08:29:56 pm
TBH, all programming is what you're doing now. Not often are there any gui's for making gui's.
You need to learn the code to make them manually.
If you did any other language it'd still be the same to begin with.

This is not a bad thing though, it teaches you more about the underlying aspects.
What you're used to seeing is what we call a "RAD", Rapid Application Development tool.

It's like using dreamweaver to make websites instead of a notepad type application.
You get a website, but underneath it's messay and nasty shit, and you don't have the knowledge to fix it if something goes wrong. Not using a RAD can help you understand and learn how to fix issues should they arise.

However, Python does have bindings for MANY different toolkits. Lots for making GUI's. I'm not sure about drag and drop... but there might even be a development environment out there that supports that too.

http://www.riverbankcomputing.co.uk/software/pyqt/intro
http://www.pygtk.org/
http://www.wxpython.org/

But tbh I wouldn't touch any of those yet.
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 08:35:03 pm
oh okay, Thats completely fine then :)
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 08:37:44 pm
Knowing Python's popularity there must be oodles of beginners tutorials out there that can help you along.
Find some of them and have a crack :>

Remember though, it's important to understand why and how, not just what you need to type to make something work :)
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 20, 2010, 08:41:38 pm
Malbodge
Title: Re: Good programming language to learn?
Post by: thatGUyAswell on November 20, 2010, 08:41:51 pm
C# ftw, especial for beginner, also Xna is really nice too, just starting the first planing of a online 3d rpg game with a friend. I wouldn't start on c or c++ if your self-teaching.

To my knowledge c# was brought out to replace vb. Schools should start teaching it instead of vb.
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 09:00:26 pm
Hmms Problems has convinced me to learn c# since it seems to be most popular, and Python seems to need other programming languages to work well.

TBH, I actually want to learn alot of programming languages, including Java, Lua and now, Python.
Title: Re: Good programming language to learn?
Post by: Codex on November 20, 2010, 09:25:24 pm
if you can pick up c or c++ as a first language, you can dominate the world.
Title: Java 4 Ever!
Post by: Tiwaking! on November 20, 2010, 09:37:35 pm
Quote from: Pyromanik;1333741
Again I'd probably use Python, if I knew it.
You should try Python. I learned how to program in Python when I made my own Mount&Blade mod. It was really, really easy.

Kayne: You should definitely give Python a go, if only to create mods and stuff. I found it quite fun having to define almost everything myself!
Quote from: Bell;1333744
Realistically you could stay with C# since the largest proportion of programmer jobs are C#
Bell is right. C# will get you a job.

Java will get you the chicks though:http://www.youtube.com/watch?v=yl1f1-Da0OI
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 09:42:32 pm
So confused, everyone is yelling at me to use different languages :P

I will probably never get a job in programming. I have an electrician apprenticeship starting next year.

Learning a language is just for fun lol
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 20, 2010, 10:13:02 pm
Send me a pm if you have any XNA questions, i'm working on a few games at the moment.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 10:32:37 pm
Quote from: `Kayne;1333788
Hmms Problems has convinced me to learn c# since it seems to be most popular, and Python seems to need other programming languages to work well.

TBH, I actually want to learn alot of programming languages, including Java, Lua and now, Python.

Python doesn't need other languages to work, it's Python.
Python is also very popular.

It really depends on what you're trying to do I think. Languages are tools in a programmers arsenal of solutions. Apply the correct tool to the right job. Everyone is telling you different things because we all have different experiences.

Python will teach you good programming basics.
C# will teach you more involved stuff.
True C will teach you more about computer composition and the like.





Also: what Codex said.
Quote from: Codex;1333802
if you can pick up c or c++ as a first language, you can dominate the world.


If you learn C, you've pretty much learnt every language that isn't FORTRAN or COBOL.
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 10:37:56 pm
Ugh lol, Do I want to be using command line, or python IDLE (gui)

Idle is just basically a notepad, instead of a command line, which is what I want. But I see no way of executing any scripts.

I think i'll give both C# and Python a good go, I guess.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 10:40:48 pm
You'll probably find a 'run' under one of the menus.
You could always choose a different IDE. There are plenty out there.


I think even medit (which IS a text editor) supports running of python code. (it's also written in python).
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 10:43:08 pm
Lol, I looked, Theres no run.

Different Ide, I spose so lol.

Just to verify, is a Shell a program of a script that is being run?
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 20, 2010, 10:46:27 pm
GoogleFu says press F5.
http://ai.uga.edu/mc/idle%5Cindex.html

Or, open the "Run" menu and select "Run Module"





Otherwise:
http://wiki.python.org/moin/PythonEditors
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 10:54:13 pm
Yeah Pyro, I worked out that IDLE is really a "Shell" (I don't know what the term means yet)

Turns out I had to go "New" to get to what I wanted.

I know... I know... "Herp Derp."
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 20, 2010, 11:04:27 pm
Quote from: `Kayne;1333829
Yeah Pyro, I worked out that IDLE is really a "Shell" (I don't know what the term means yet)

Turns out I had to go "New" to get to what I wanted.

I know... I know... "Herp Derp."

Do you really not understand the concept of a shell?
Title: Re: Good programming language to learn?
Post by: Kayne on November 20, 2010, 11:14:52 pm
The outer casing?
A hollow casing?
A defensive layer?

I'm guessing the main word would be casing?
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 21, 2010, 12:35:29 am
You should totally learn punch card programming, it's totally in demand right now. You can get 150k+ for punch card programming.
Title: Re: Good programming language to learn?
Post by: Kayne on November 21, 2010, 01:21:18 am
Quote from: Spacemonkey;1333851
You should totally learn punch card programming, it's totally in demand right now. You can get 150k+ for punch card programming.
First one to make a working version of Crysis wins
Title: Re: Good programming language to learn?
Post by: Bell on November 21, 2010, 01:50:11 am
Quote from: Problems;1333781
just starting the first planing of a online 3d rpg game with a friend.

Every beginner game dev hobbyist has the dream of making an online 3rd RPG game.
They are one of the hardest and most content filled games imaginable and therefore generally a terrible idea to attempt.
Even a Offline 2D RPG is a shit ton of work, because the game is all about content and not so much about game mechanics.
Title: Re: Good programming language to learn?
Post by: Kayne on November 21, 2010, 02:05:25 am
TBH my goal is to make a 3d fps, I'll probably get my brother to do the 3d shit and i'll just some how work with it.
Title: Re: Good programming language to learn?
Post by: Bell on November 21, 2010, 02:08:43 am
Mod an existing FPS into the game you want.

Actually I have the perfect thing for you.
http://www.udk.com

If I had time to make my own game I would be doing it with that.
I've already mucked around with it abit, I was easily able to modify the guns, change the flight dynamics of one of the vehicles and created a terrain map of Cassino Italy using real world height map information.
Very cool.

Actually I'd recommend that to anyone wanting to try a 3D online RPG too.
It has full networking support you can modify it somewhat for your own needs and obviously the 3D part is taken care of for you.
Which puts you years ahead of making your own engine and you can spend all of your time actually working on the game/storyline
Title: FPS Creator: The easy way to make a First Person Shooter!
Post by: Tiwaking! on November 21, 2010, 06:14:31 am
Quote from: `Kayne;1333868
TBH my goal is to make a 3d fps
Quote from: Bell;1333869
Mod an existing FPS into the game you want.
Two of the groups in game development used a program called "FPS Creator" to make their games.

One was called "Sure Shot S.I.T" and the map was of the Information Technology Block (I-Block). You were a disgruntled ex-student who comes back to BIT with a machine gun and thoughts of vengeance. Turns out all of BIT has been zombiefied and you are trapped and have to kill everyone to get out.

Ken Sutton was most disturbed at the screenshots of Zombie Ken Sutton being killed in his office.
Title: Re: Good programming language to learn?
Post by: Bell on November 21, 2010, 11:18:26 am
Quote
Design your own first person shooter games

No coding required!

Create your game instantly with the intuitive 3D editor. Drag and drop walls, lights, doors, enemies, ammo, weapons and more - with pixel perfect precision, and watch as they intelligently link together. Then with one click of the mouse, play your game!

I hope they failed
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 21, 2010, 12:19:44 pm
Quote from: Bell;1333865
Quote from: Problems;1333781
just starting the first planing of a online 3d rpg game with a friend.

Every beginner game dev hobbyist has the dream of making an online 3rd RPG game.
They are one of the hardest and most content filled games imaginable and therefore generally a terrible idea to attempt.
Even a Offline 2D RPG is a shit ton of work, because the game is all about content and not so much about game mechanics.

Agreed.

Unless you have a dedicated artist in your team (or a team of dedicated artists), making a content heavy game is a wrong way to go.

I think, if you're just a programmer, make a simple game, but with an interesting and unique gameplay.

or just make a space invaders clone.

Title: Re: Good programming language to learn?
Post by: private_hell on November 21, 2010, 12:47:51 pm
Quote from: Codex;1333802
if you can pick up c or c++ as a first language, you can dominate the world.

i do this and dominate the world (its my little world but i still dominate it) :D
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 21, 2010, 01:05:49 pm
Best advice is to branch out into a few useful languages.


I've been trying to learn C++ though, but i've only been able to find tutorials which teach the basics, which are the same for any language.
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 21, 2010, 01:22:35 pm
Quote from: Bell;1333869
Mod an existing FPS into the game you want.

He could learn LUA. He is a gmod admin after all.
Quote from: `Kayne;1333836
The outer casing?
A hollow casing?
A defensive layer?

I'm guessing the main word would be casing?

I am not sure if you are being flippant or not, sooooo..

A shell is a program that provides the user with a interactive interface to the computer's resources, like disks and whatnot. Shells that use a command line interface (like cmd.exe and bash, for example) have a interpreted programming language (meaning it's programs don't have to be compiled to run) and in addition to being able to type commands in one by one you can have the shell read them from a text file, variously called shell scripts and batch files.

Many home computers of the 1980s booted from ROM into interface very similar to IDLE's Python Shell, only in a another very popular interpreted language call BASIC. These days however shell can refer to everything from GUI Desktop environments (like Explorer.exe and GNOME KDE etc) to the thing you type your serach into google with.

Title: Re: Good programming language to learn?
Post by: Pyromanik on November 21, 2010, 01:40:22 pm
Don't be too harsh, everyone starts somewhere.

But that's a good overall description of a shell, yeh.
In a way, it is an outer casing, it is responsible for almost all you see and do with your computer at the user level.
Or at a specific subset of, such as the Python shell. Responsible for all things Python.

It takes time to learn and get your head around the concepts. But you have to learn the basics before you can dive in any deeper. I remember when I first started learning programming (C++). I just wanted to make forms all day, but I had no idea on how to make them actually function (Borland C++ Builder).
Title: Re: Good programming language to learn?
Post by: Kayne on November 21, 2010, 02:23:00 pm
Lol cheers guys :P

And umm

Quote from: Spoonguard;1333995
He could learn LUA. He is a gmod admin after all.


Ehh, The only thing you could do with gmod with lua is make addons (http://www.garrysmod.org/downloads/). Which isn't really my kind of thing lol.
Unless you're thinking about Expression2, Which is the programming language which you write ingame to make your stuff do cool shit :P. I was talking To Grumpy Hitler and He was telling me that E2 is pretty much based off the general C programming languages.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 21, 2010, 02:25:16 pm
LOTS of languages are.
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 21, 2010, 04:04:41 pm
Quote from: Pyromanik;1334001
Don't be too harsh, everyone starts somewhere.

I didn't mean to come off as harsh. I just find it hard to believe that he honestly didn't know what a shell was. Then again, I guess fewer and fewer people have played around with pre-32-bit computers these days.
Title: Re: Good programming language to learn?
Post by: thatGUyAswell on November 21, 2010, 05:01:23 pm
Quote from: Bell;1333865
Quote from: Problems;1333781
just starting the first planing of a online 3d rpg game with a friend.

Every beginner game dev hobbyist has the dream of making an online 3rd RPG game.
They are one of the hardest and most content filled games imaginable and therefore generally a terrible idea to attempt.
Even a Offline 2D RPG is a shit ton of work, because the game is all about content and not so much about game mechanics.

That's why I'm doing it with a friend, who has experience:P
Title: Re: Good programming language to learn?
Post by: Bell on November 21, 2010, 05:47:22 pm
Quote from: Problems;1334061
That's why I'm doing it with a friend, who has experience:P

It's not an issue of experience, more of time and manpower.
You realise there are entire game studios who won't touch RPG's due to their scope.

What is your scope?
Are you making it to learn or do you actually want people to play it?
Title: Game Development: Project Scopes
Post by: Tiwaking! on November 21, 2010, 07:19:48 pm
Quote from: Bell;1334072
It's not an issue of experience, more of time and manpower.
You realise there are entire game studios who won't touch RPG's due to their scope.

What is your scope?
Are you making it to learn or do you actually want people to play it?
Woah! Hold up there!

This is a bigger question than you'd think, especially for a beginner. To simplify this question down we shall use the 5W's and H approach:

Who is the game intended for? - If it is "Just me" then you should rush in and start typing away. That is the way I started.

Why are you making the game? - You could be making it just for the experience of making a game or you could be making it to fulfil a need. If you're just making it for XP points, then you should rush in and type away! Make a whole thread (our programming forum needs more threads!) about what you are making and just ask questions about CONCEPTS, not the overall scope. We are here to help, not live your life for you :P

What will you be using to make the game? - List what language and tools you will be using. For example: I use BlueJ and Java with the JLayer package for mp3 sounds.

When do you think you will finish the game? - Every game idea NEEDS an endpoint, a point where you will consider it 'complete enough to play and be fun enough to justify the effort'. This may not be the absolute endpoint, but would definitely be something you would like to show off to others.

Where too from here? - Now you've got your tools, players, concept and possible time frame: What are you going to do after it is done? This is actually one of the most fun parts of development. e.g I've been working on Street Fighter 2 for Java (because all the SF2 online applets are horrible). Where too after it is done? Well. I could put more characters in, which I have done! pre-Shippuden Naruto is in there and he has the Kage-Bunshin as his special move.


And finally: HOW will you achieve your goals? - If you are doing it solely for yourself, then this is somewhat irrelevant.



And please please please dont generalise your answers. "I am making it for FPS players!" is not a good answer for anything. "I am making it for Halo fans!" is better.
Title: Re: Good programming language to learn?
Post by: Blob_ZPS on November 21, 2010, 09:11:44 pm
Quote from: `Kayne;1333788
Hmms Problems has convinced me to learn c# since it seems to be most popular, and Python seems to need other programming languages to work well.

TBH, I actually want to learn alot of programming languages, including Java, Lua and now, Python.

Lua is what Gmod uses.
Title: Re: Good programming language to learn?
Post by: Kayne on November 21, 2010, 10:15:11 pm
Yeah but I don't want to make addons for gmod. Craig wouldn't want to put all my failed addons on the server anyway :P
Title: Re: Good programming language to learn?
Post by: thatGUyAswell on November 21, 2010, 10:48:07 pm
Bell, more of an experience...but graphics will be like runescape so I can make textures my self, and I know a modeler who is willing to help. Morly so just doing all the coding side of things with a small level.

By the way, Glua is a bitch to debug, Gmod kept telling me wrong lines of code that were wrong. :!
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 21, 2010, 10:51:58 pm
Quote from: Problems;1334166
Bell, more of an experience...but graphics will be like runescape so I can make textures my self, and I know a modeler who is willing to help. Morly so just doing all the coding side of things with a small level.

By the way, Glua is a bitch to debug, Gmod kept telling me wrong lines of code that were wrong. :!

What, you expect something other than problems??

Implement your own debugger...
Title: Re: Good programming language to learn?
Post by: Kayne on November 21, 2010, 11:12:16 pm
With the help of Problems, I am now downloading a legit version of Visual Studio 2010 >.<

Still keen to give Python a go but haven't had much time today lol
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 21, 2010, 11:25:18 pm
Quote from: `Kayne;1334173
With the help of Problems, I am now downloading a legit version of Visual Studio 2010 >.<

Still keen to give Python a go but haven't had much time today lol

Expect Problems!

But at least you won't have Issues.
Title: Re: Good programming language to learn?
Post by: Menial on November 21, 2010, 11:28:21 pm
c# is all I know, and still, that ain't a lot.

I remember this analogy about c and c#: c is like a chainsaw without the guard, more powerful, but requires more expertise to use without fucking something up, c# is safer to learn but has limitations compared to c.

I think it's from the yellowbook, google it, it's supposed to be a pretty handy book for learning c#.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 21, 2010, 11:29:39 pm
Visual studio is powerful indeed.
But barely touched by the beginner.

At least it will give you a nice startpoint for many languages.


Also, if we're on the subject of textbooks:
Cay Horstmann.

I book I was required to have; never opened.
But I'm sure it'll be helpful for many beginners. It really does seem pretty good.
Title: Re: Good programming language to learn?
Post by: Kayne on November 21, 2010, 11:57:51 pm
Still trying to muck around with Python, and its like the guy in the tutorial isn't even using english to explain it...
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 22, 2010, 12:09:41 am
He probably isn't.
Title: Re: Good programming language to learn?
Post by: Kayne on November 22, 2010, 12:52:07 am
Now installing Microsoft Visual Studio Professional 2010.

I don't need to worry now, I guess :P
Title: Re: Good programming language to learn?
Post by: Greaver on November 22, 2010, 01:25:58 am
I have found Visual Studion awesome for learning the basics of coding, just having it give you the expected responses when typing each bit of code helps.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 22, 2010, 07:38:17 am
I just hooked visual studio up to my xbox 360, time to make some games.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 22, 2010, 01:18:49 pm
Yeh, the VS debugger is quite good iirc. Easy to use.
Title: Re: Good programming language to learn?
Post by: Bell on November 22, 2010, 01:33:24 pm
It's the best.
So much nicer using VS to debug a xbox build compared to using the crap you have to use with PS3.

And if you are doing C# work the intellisence is amazing.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 22, 2010, 02:03:49 pm
Drinking a beer makes you program better.

Drinking two makes it worse.
Title: Beer and programming
Post by: Tiwaking! on November 22, 2010, 02:12:47 pm
Quote from: Spacemonkey;1334316
Drinking a beer makes you program better.
(http://imgs.xkcd.com/comics/ballmer_peak.png)
Title: Re: Good programming language to learn?
Post by: Kayne on November 22, 2010, 03:00:54 pm
Quote from: Spacemonkey;1334316
Drinking a beer makes you program better.

Drinking two makes it worse.

Not for me lol :P
Title: Re: Good programming language to learn?
Post by: Bell on November 22, 2010, 03:02:30 pm
You must find your alcohol balance young padawan
Title: Re: Good programming language to learn?
Post by: Kayne on November 22, 2010, 03:11:43 pm
silly people. :P

I have things in my life that do not allow me to drink alcohol lol.

But I don't want to be a sympathy case, Lets just leave it at that.

date : 21 June 2012, Boy was I Wrong. I can drink what ever the fuck I want

date : 16th November 2015 Jesus I laughed so hard at this post. Good times. Good times.
Title: Re: Good programming language to learn?
Post by: Bell on November 22, 2010, 03:15:13 pm
Meh alcohol is overrated.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 22, 2010, 03:17:40 pm
A programmers fuel is coffee.
Title: Re: Good programming language to learn?
Post by: Kayne on November 22, 2010, 03:54:27 pm
Lol. So keen to start learning but problems is still at school. He probably wont get home for like 2 hours.

hurrrr.... I would start now but Visual Studio required me to chose a default language. I would go C# but problems said something about F#

... cannot...wait...anymore...
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 22, 2010, 04:10:02 pm
Go C#


F# is just for maths programming or something like that.
Title: Re: Good programming language to learn?
Post by: Bell on November 22, 2010, 04:11:44 pm
C# do it.

You can make games with it.
It is relatively easy to learn.
And has the best job opportunities.
Title: Re: Good programming language to learn?
Post by: AintNoMeInTeam on November 22, 2010, 06:56:07 pm
i agree, go with C#
Title: Re: Good programming language to learn?
Post by: toofast on November 22, 2010, 08:19:51 pm
Go into VS, make a new app, choose windows form application. It will make a form for you. Throw a button, and a textbox on there. double click on the button, and it will make an event. Add some code into it, to make it display something in the text box when you hit the button (textbox.text = "blah"), compile/run, and you have your first program up and running.

Then from there just add more things onto it, investigate other toolbox things. I suggest looking at things like timers, background workers, multiline textboxes etc. Just go onto msdn, search the item, and it will give you some sample code using it. Just copy and paste that into your program, then play around with it.

Maybe set yourself a goal of making a simple program to do something.
Title: Re: Good programming language to learn?
Post by: Speakman on November 22, 2010, 08:21:28 pm
one of my first coding exercises i remember was in VB, we made a calculator app. was pretty cool. then we made minigolf
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 22, 2010, 08:44:00 pm
Quote from: toofast;1334448
make it display something in the text box when you hit the button (textbox.text = "blah")


Bullshit.
Everyone knows the text MUST be "Hello world."
These are the rules.
Title: Re: Good programming language to learn?
Post by: Virus. on November 22, 2010, 09:23:22 pm
Dang, this programming shit sounds interesting. The most experience I have with it though is source engine scripting. I'm also interested in modelling. I'm really not sure what type of brain I am that would make me better for one or the other. Being able to make game characters do certain stuff sounds cool to me, but making a gun or a model doesn't sounds to bad either.

Well, I've gotten pretty good at scripting if that's any help, and I find getting it all to work together enjoyable. I have now gone over the top and use a fast setting change and weapon use script for every character in TF2.

And then there's website design, which doesn't sounds too bad either.

Dang, what to do?
Title: Re: Good programming language to learn?
Post by: toofast on November 22, 2010, 10:01:39 pm
Quote from: Pyromanik;1334460
Quote from: toofast;1334448
make it display something in the text box when you hit the button (textbox.text = "blah")


Bullshit.
Everyone knows the text MUST be "Hello world."
These are the rules.

Those be the rules in the console. The only rule for text boxes is there are no rules. They be wild.
Title: Re: Good programming language to learn?
Post by: Kayne on November 22, 2010, 10:04:40 pm
yeah, the form is EXACTLY like visual basic. I spose i'll make a calculator.

Dammit, I remember why I didn't make a calculator in Visual Basic.

I'm not quite sure how to make the numbers work i.e, if you press 8, Then press 3, I have no idea how to make it change from 8 to 83...Unless I times 8 by 10... oooobrb
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 22, 2010, 10:27:49 pm
Windows forms is old, WPF is the new Windows forms.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 22, 2010, 10:32:25 pm
Quote from: `Kayne;1334480
I'm not quite sure how to make the numbers work i.e, if you press 8, Then press 3, I have no idea how to make it change from 8 to 83...Unless I times 8 by 10... oooobrb

Add each key press to a character string, then parse the string to a number when you do the calculation.
Title: Re: Good programming language to learn?
Post by: Kayne on November 22, 2010, 10:44:54 pm
I can no longer set a label's caption to a number, wtfwtfwtfwtf

Might just wait for Problems.

I've set a interger variable with int x, z;
and i'm trying to edit the x value everytime a button is pressed, This is the coding I wrote for the number 1 button.

Code: [Select]
x = x * 10 + 1;
label1.Text = x;

It doesn't seem to like the fact that I want to "implicity convert type 'int' to 'string'"

Why nottttttttttttttttttttttttttttttttttttttttttttt
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 22, 2010, 10:49:31 pm
Quote from: toofast;1334479
Quote from: Pyromanik;1334460
Quote from: toofast;1334448
make it display something in the text box when you hit the button (textbox.text = "blah")


Bullshit.
Everyone knows the text MUST be "Hello world."
These are the rules.

Those be the rules in the console. The only rule for text boxes is there are no rules. They be wild.

That's cake and you know it.
A GUI is the beginning of a brave new world...
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 22, 2010, 10:51:45 pm
Quote from: Virus.;1334471
Dang, this programming shit sounds interesting. The most experience I have with it though is source engine scripting. I'm also interested in modelling. I'm really not sure what type of brain I am that would make me better for one or the other. Being able to make game characters do certain stuff sounds cool to me, but making a gun or a model doesn't sounds to bad either.

Well, I've gotten pretty good at scripting if that's any help, and I find getting it all to work together enjoyable. I have now gone over the top and use a fast setting change and weapon use script for every character in TF2.

And then there's website design, which doesn't sounds too bad either.

Dang, what to do?

Web has a low barrier of entry. If you're one of the rare kind that can do both good code and good design, then you could go far. But it's a tough market for jobs. Gotta have some kind of in, and experience counts for a lot.

Go do some tertiary study, take a range of courses, see what you like more after doing them all a bit. Also, party hard and have fun (but don't forget to actually do some study like I did, or you'll fail... like I did).
Title: Re: Good programming language to learn?
Post by: toofast on November 22, 2010, 11:09:34 pm
Quote from: `Kayne;1334494
I can no longer set a label's caption to a number, wtfwtfwtfwtf

Might just wait for Problems.

I've set a interger variable with int x, z;
and i'm trying to edit the x value everytime a button is pressed, This is the coding I wrote for the number 1 button.

Code: [Select]
x = x * 10 + 1;
label1.Text = x;

It doesn't seem to like the fact that I want to "implicity convert type 'int' to 'string'"

Why nottttttttttttttttttttttttttttttttttttttttttttt


Well .Text is a string property of the textbox, while x is an int. The problem is you are converting the variable, without telling c# you want to. So the compiler is complaining. To fix this just go label1.Text = x.toString();

or

you can type cast. which is where you go (type you want) variable. so text = (string)x; [though i am not sure if you can cast int to string]

http://msdn.microsoft.com/en-us/library/ms173105.aspx

As always msdn is your friend.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 22, 2010, 11:37:27 pm
Strong typed language buddy, none of this soft scripty shit.
Luckily you have an array of nifty library functions available to you, such as toString and the like.
They make programming easy :>
(as opposed to C proper, going it alone with the likes of atoi() like a real hardman xD)
Title: Re: Good programming language to learn?
Post by: Kayne on November 23, 2010, 12:18:56 am
Its 1 step forwards and 2 steps back with programming lol.

Time to wait for tomorrow.
Title: Re: Good programming language to learn?
Post by: toofast on November 23, 2010, 12:21:42 am
Don't you mean sprintf(). atoi() is string to int.

But yea, thats why i like c#. It has a lot of decent methods already set up, to do some of the more tricky stuff, so you don't need to waste time writing all of the low level things.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 23, 2010, 12:25:34 am
Quote from: toofast;1334534
Don't you mean sprintf(). atoi() is string to int.

But yea, thats why i like c#. It has a lot of decent methods already set up, to do some of the more tricky stuff, so you don't need to waste time writing all of the low level things.

char* to int ;D

and yes, I know. I couldn't be arsed changing it after I realised.
And no, I didn't mean sprintf, I meant itoa(). Type conversion, not printing.


And C# really is just MS's version of Java huh.
Title: Re: Good programming language to learn?
Post by: toofast on November 23, 2010, 12:28:50 am
Quote from: Pyromanik;1334535
Quote from: toofast;1334534
Don't you mean sprintf(). atoi() is string to int.

But yea, thats why i like c#. It has a lot of decent methods already set up, to do some of the more tricky stuff, so you don't need to waste time writing all of the low level things.

char* to int ;D

and yes, I know.
And no, I didn't mean sprintf, I meant itoa()

wouldn't you use sprintf over itoa(), since itoa is nonstandard. And you say array of char, i say string :P
Title: This isnt madness, this....is....JAVA!
Post by: Tiwaking! on November 23, 2010, 06:50:34 am
Quote from: `Kayne;1334494
Code: [Select]
x = x * 10 + 1;
label1.Text = x;
You can use a dirty way to do this in Java by simply adding the number to an empty string. Probably shouldnt do this though.
Code: [Select]
x=x*10+1;
label1.setText(""+x);
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 23, 2010, 07:30:25 am
I find string.format really useful

string someWords = string.format("Words and shit {0} {1}", x , y);

{0} and {1} are replace by x and y respectively. Where x/y can be a number or a string.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 23, 2010, 08:22:38 am
If you have access to dreamspark, see if you can get a XNA Creators Club Academic Membership, then you can run your games on your xbox 360.


However, if you don't have an xbox, then it wouldn't be much use.
Title: Dreamspark question
Post by: Tiwaking! on November 23, 2010, 08:39:04 am
Quote from: Spacemonkey;1334562
If you have access to dreamspark, see if you can get a XNA Creators Club Academic Membership, then you can run your games on your xbox 360.


However, if you don't have an xbox, then it wouldn't be much use.
I thought you needed two licenses for xbox 360 development?

I know I have two: The Dreamspark one and some other one.

And I will probably never use them.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 23, 2010, 09:05:12 am
The Academic one allows you to deploy your games to an xbox for testing.


The full paid membership allows the above, and also the ability to submit games to the xbox marketplace.

Title: Re: Good programming language to learn?
Post by: Kayne on November 23, 2010, 01:34:43 pm
My brother has an xbox... I might buy it off him if I learn C# :>
Title: Re: Good programming language to learn?
Post by: Kayne on November 23, 2010, 01:59:25 pm
Quote from: Spacemonkey;1334552
I find string.format really useful

string someWords = string.format("Words and shit {0} {1}", x , y);

{0} and {1} are replace by x and y respectively. Where x/y can be a number or a string.

Now you tell me D:

Anyways, If anyone can help me with this one tiny bit
Code: [Select]
int x = x * 10 + 1;
It says i'm using an unassigned variable x (the x is the second one in)
Whats wrong with it? :<
Title: Re: Good programming language to learn?
Post by: Bell on November 23, 2010, 02:11:19 pm
Well how can x = x when x doesn't exist yet?
What is x * 10 when x is undefined?

does not compute :p
Title: Re: Good programming language to learn?
Post by: Kayne on November 23, 2010, 02:13:13 pm
Quote from: Bell;1334679
Well how can x = x when x doesn't exist yet?
What is x * 10 when x is undefined?

Does not compute :p

Ahh. Silly kayne.

Yeah I spose I just ignored that, and just assumed X = 0

How come I can never set a variable across the whole script? I want it to set x to 0 on form Load, but it says "x is defined but never used"
Title: Re: Good programming language to learn?
Post by: Bell on November 23, 2010, 02:14:25 pm
int x = 0
x = x * 10 + 1
Title: Re: Good programming language to learn?
Post by: Kayne on November 23, 2010, 02:19:28 pm
Yeah I just did that lol, works :>

Once I get if statements worked out (I haven't even taken a stab yet, Hoping it all goes well), I should have a working calculator :>

edit : ffs, This is why I need global variables lol.

Everytime I click the button, it resets x to 0, then times by 10 (=0) then +1


Got it working, Its all to do with the squiggly brackets :D
Title: Re: Good programming language to learn?
Post by: Bell on November 23, 2010, 02:26:38 pm
haha the joys of starting to program, I remember doing shit like that using borland delphi
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 23, 2010, 02:29:07 pm
static is useful for global constants.

public class SampleClass
{
public static int Anumber = 0;
}

Then you can access that value elsewhere in code like so

SampleClass.Anumber
Title: Re: Good programming language to learn?
Post by: Kayne on November 23, 2010, 02:30:54 pm
You call it joys... I call it a pain in the ass :P

It now does some random shit when it gets to the 1,000,000,000's, and eventually goes back to 0 lol

and cool, Cheers Spacemonkey, I was just doing saying there was a x variable in "public partial class Form1 : Form"
and changing the value in form_load(), to 0
Title: Re: Good programming language to learn?
Post by: Bell on November 23, 2010, 02:32:37 pm
overflow
http://en.wikipedia.org/wiki/Integer_overflow
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 23, 2010, 02:33:31 pm
Int is a 32 bit Integer, it has a maximum value of 2,147,483,647.

Use long instead, it's a 64 bit Integer, and has a max of 9,223,372,036,854,775,807.


Here's more info about different Interger types
http://msdn.microsoft.com/en-us/library/exx3b86w.aspx

If you want to do floating point calculations (12.7 + 29.45 etc), it would be best to use a double
http://msdn.microsoft.com/en-us/library/9ahet949.aspx
Title: Re: Good programming language to learn?
Post by: Kayne on November 23, 2010, 02:35:46 pm
Where is the like button for these forums, You guys are so helpful lol
Title: Re: Good programming language to learn?
Post by: Bell on November 23, 2010, 02:45:06 pm
Quote from: Spacemonkey;1334702

If you want to do floating point calculations (12.7 + 29.45 etc), it would be best to use a double
[url]http://msdn.microsoft.com/en-us/library/9ahet949.aspx[/url]


Unless you are doing games, we always use float since we generally don't need a number as big as a double and 32bit hardware handles floats faster and they take up less memory.
Double is generally reserved for hardcore mathematic equations.

I used double all through uni and on the first day in game dev they were like "wooah don't do that!"
Title: Re: Good programming language to learn?
Post by: Kayne on November 23, 2010, 05:48:05 pm
cough cough...first program in C#....cough...

I don't like the fact that it installs, I would of rather it just run off a exe, But I have no clue on how to fix that atm.
Also sorry about the name, I stamped the name calculator inside the program all over the place, but it still wants to be windows application form 2. sigh.

Make sure to remove it via add or remove programs after you've played around with your awesom-o calculator.
Title: Re: Good programming language to learn?
Post by: Bell on November 23, 2010, 05:52:54 pm
Now replace all of your instances of int with double and stuff like 1/100 won't equal 0 ;)

Good job tho.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 23, 2010, 05:59:17 pm
Quote from: `Kayne;1334771
cough cough...first program in C#....cough...

I don't like the fact that it installs, I would of rather it just run off a exe, But I have no clue on how to fix that atm.
Also sorry about the name, I stamped the name calculator inside the program all over the place, but it still wants to be windows application form 2. sigh.

Make sure to remove it via add or remove programs after you've played around with your awesom-o calculator.

You don't need to make it as a setup package.

Go into to bin/debug (or release), it will be there as an exe.


However the setup ensures the correct version of the net framework is installed.
Title: Re: Good programming language to learn?
Post by: Kayne on November 23, 2010, 06:12:58 pm
Quote from: Bell;1334778
Now replace all of your instances of int with double and stuff like 1/100 won't equal 0 ;)

Good job tho.

Facepalm lol

Quote from: Spacemonkey;1334785
Go into to bin/debug (or release), it will be there as an exe.

All I did was "release "Calculator"". I also can't find what your talking about, the files in the rar are all the files I could get out of it lol. No exe's :x
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 23, 2010, 06:43:20 pm
Quote from: `Kayne;1334788

Quote from: Spacemonkey;1334785
Go into to bin/debug (or release), it will be there as an exe.

All I did was "release "Calculator"". I also can't find what your talking about, the files in the rar are all the files I could get out of it lol. No exe's :x

The bin folder should my in your project folder along with your source code.

You project folder should be somewhere like 'Documents/Visual Studio 1020/Projects/'


After you click build in VS, the binary exe file should be in the Bin folder, in a sub folder called debug, or release, depending on which mode you choose to build it.

This is what one of my projects looks like.

Title: Re: Good programming language to learn?
Post by: toofast on November 23, 2010, 07:03:41 pm
Quote from: `Kayne;1334771
cough cough...first program in C#....cough...

I don't like the fact that it installs, I would of rather it just run off a exe, But I have no clue on how to fix that atm.
Also sorry about the name, I stamped the name calculator inside the program all over the place, but it still wants to be windows application form 2. sigh.

Make sure to remove it via add or remove programs after you've played around with your awesom-o calculator.

The trick with names is you need to name it correctly the first time you make the project. Once you make the name, it goes into the code (namespace calculator for example), and thats what it will be called. When you save it, it lets you pick another name, which is what the folder is named.

Also maybe you should upload your VS files, so then we can see your source code, see what improvements you can make. Plus then we can just compile/run within VS instead of using installers.
Title: Re: Good programming language to learn?
Post by: Kayne on November 23, 2010, 07:21:07 pm
Cheers guys, understood, And yeah I found the exe of it :>

I'm trying not to be so "herp-derp", But what Visual Studio files are you wanting , in particular?

I'm guessing these
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 24, 2010, 08:55:05 am
Yep, they are the ones.

I ran it, used it to calculate my taxes, I owe 0 dollars, good job :D
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 24, 2010, 02:58:22 pm
Quote from: Spacemonkey;1334976
Yep, they are the ones.

I ran it, used it to calculate my taxes, I owe 0 dollars, good job :D

I ran it, amused myself with the overflow errors
Title: Re: Good programming language to learn?
Post by: Virus. on November 24, 2010, 05:09:17 pm
Ok, so I'm going to give programming go. However, I don't know where the place for me to start is.

I'm interested in game modding, for other people or me. This will probably always be a hobby. What should I start learning and how?
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 24, 2010, 05:18:16 pm
You can download Visual Studio Express in your language of choice here.
http://www.microsoft.com/express/Downloads/

If you want to start really easy, you can start with small basic
http://smallbasic.com/


I'm not sure what you need for game modding.
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 24, 2010, 06:00:51 pm
Quote from: Spacemonkey;1335222
You can download Visual Studio Express in your language of choice here.
[url]http://www.microsoft.com/express/Downloads/[/url]

If you want to start really easy, you can start with small basic
[url]http://smallbasic.com/[/url]


I'm not sure what you need for game modding.


Generally, C and C++. Most game engines have a high-level scripting language based on either C or C++. Exceptions include Unity3D, which uses Mono (.NET); Gamebyro, which uses Lua.
Title: Re: Good programming language to learn?
Post by: Bell on November 24, 2010, 06:16:07 pm
I dunno, I wouldn't recommend to someone who wants to dabble in game modding to learn C and C++.

They don't need to learn memory management or any OO, just need basic scripting skills.
BF2 i think used a fairly simple set of python scripts to access game engine variables etc.
Title: Re: Good programming language to learn?
Post by: Kayne on November 24, 2010, 06:28:54 pm
Buy gmod and learn expression 2, Fairly easy.

Once you've learnt that, learn lua and mod your own addons :>
Title: Re: Good programming language to learn?
Post by: thatGUyAswell on November 24, 2010, 06:53:55 pm
Lol expression 2 is so easy, it's epic.
Title: Re: Good programming language to learn?
Post by: Virus. on November 24, 2010, 08:42:03 pm
I'm not Gmod modding. No.

A few open games use Python, like Mount & Blade, I'm interested in that. What's the Source engine use?

Remember, this is just modding a game into my own, nothing more.
Title: Re: Good programming language to learn?
Post by: Kayne on November 24, 2010, 08:50:45 pm
Quote from: Virus.;1335329
I'm not Gmod modding. No.

A few open games use Python, like Mount & Blade, I'm interested in that. What's the Source engine use?

Remember, this is just modding a game into my own, nothing more.

You can with gmod lol, You don't have to make a full on game, just a game mode.
Title: Re: Good programming language to learn?
Post by: Virus. on November 24, 2010, 09:31:01 pm
I'm sorry Kayne. Did I not make it clear the first time?

Unless you can turn it into another game that isn't Gmod. No.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 24, 2010, 09:34:37 pm
Quote from: Spacemonkey;1334552
I find string.format really useful

string someWords = string.format("Words and shit {0} {1}", x , y);

{0} and {1} are replace by x and y respectively. Where x/y can be a number or a string.

Looks like a half arsed regular expression.


Quote from: Virus.;1335219
Ok, so I'm going to give programming go. However, I don't know where the place for me to start is.

I'm interested in game modding, for other people or me. This will probably always be a hobby. What should I start learning and how?

Python is probably your best bet.
That or Lua.
Title: Re: Good programming language to learn?
Post by: Virus. on November 24, 2010, 09:42:43 pm
Where (other than Gmod) is Lua used and for what?

And what about Source engine?
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 24, 2010, 09:44:02 pm
Well; use google.

Source has the Source SDK.

Crytek:
http://www.crymod.com/portal.php

Unreal Engine's UDK

etc.
Most require you to know a real language.
I know lua is used in a few places, but can't find any specific references atm.

As mentioned BF2 uses Python.

As to many open projects.
Spring Engine uses Lua, if you were into RTS. They have a pretty good guide on how to develop units and the like also. It's pretty straightforward until you get to the COB scripting part :/
Title: Re: Good programming language to learn?
Post by: Virus. on November 24, 2010, 09:48:21 pm
Hmmm. C++.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 24, 2010, 09:50:54 pm
Yup.

Quote from: Virus.;1335358
Hmmm. C++.
Quote from: Pyromanik;1335356
Most require you to know a real language.

Which is why you might wanna investigate making an application first. Get your feet wet.
I know you're finishing school soon, so to a uni or tech and study, it's much easier to learn the harder stuff when you have a sense of compulsion. And a shittonne of people around to help you (as opposed to half finished internet tutorials and basics that you outgrow fast).
Title: Mount&Blade: Python Programming
Post by: Tiwaking! on November 24, 2010, 09:55:32 pm
Quote from: Virus.;1335329
A few open games use Python, like Mount & Blade, I'm interested in that.
Mount&Blade is my python programming passion.

http://forums.getsome.co.nz/index.php/topic,45338.0.html

Loads of help from the Mount&Blade forums for budding modders. The only let down is the loss of the 'big name' mods like "Fantasy Mod" and "Craftmod".

Maybe someone will, one day, take up their fallen reins.
Title: Re: Good programming language to learn?
Post by: Catalyst on November 24, 2010, 09:57:19 pm
tiwa, putting a title on each of your posts is really annoying, shows differently on the main page then i end up back in threads i dont care about
not sure if anyone else gets annoyed by this


/rant
Title: Re: Good programming language to learn?
Post by: Menial on November 24, 2010, 10:07:04 pm
I like it.
Title: Re: Good programming language to learn?
Post by: Virus. on November 24, 2010, 10:24:27 pm
What would be the best if I wanted to get into game modding, Python or C++? Take into account the learning curve etc.
Title: Re: Good programming language to learn?
Post by: toofast on November 24, 2010, 10:27:42 pm
whats a good IDE in linux to make c++ form guis, like visual studio does. I got this client program on linux, and i need to add some extra functionality to it, but i rather not have to add all the extra stuff by hand (like declaring another button, then setting up properties etc). There probably more info i need to give, but i dont have the program on me.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 24, 2010, 11:52:29 pm
^ depends. On a number of things, most of all the toolkit being used.
If it's Qt, use Qt designer, it comes with the Qt package.

If not...
geezus man, must be a pretty shit distro if you can't "pacman -Ss IDE" or "apt-get imnotadebianfanhowdoesthisshitwork?".

Try Code::Blocks?
Ajunta
Kate
Kdevelop
Eclipse

It's more than likely much easier to find out the toolkit and code in your gui by hand. They're not hard.
GTK's like laying out HTML.


Quote from: Catalyst;1335366
tiwa, putting a title on each of your posts is really annoying, shows differently on the main page then i end up back in threads i dont care about
not sure if anyone else gets annoyed by this


/rant

I love it.
Not Tiwa's fault the forums are shit and use a crazy linked list system.
Or that the admins removed the ability for us to see post titles inside a thread... and never put them back.





--------------------------------------------------



Right. Now that both our new programmers have mades something useful (well, a poorly typed but rather functional calculator in C# by Kayne and a hello world in python by Virus), It's time for the next logical step in challenging progression.

Mission 1: Investigate arrays.
Y'all now got to make me a console (command line interface) based noughts and crosses application.

Rules:







You've got 1 week.

Go.
(entries from someone who is neither Kayne or Virus [or possibly someone else suitably new to programming] don't count, and you'll be held responsible for ruining the fun by posting answers and trying to steal the limelight. Probably by being called a dick by me).
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 12:21:54 am
Fucking - Keen.

Is it okay if we post out progress as we go, as in...

I think I've finished it, so i post. If there are errors, and you guys tell me about them, can i resubmit a later version?
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 25, 2010, 12:26:12 am
Yup, of course (See rule 3).

The point of the exercise is to investigate arrays, incase you missed it.
So you'll lose points if you find some other fucked up way to do it (honestly, arrays are the easiest). Preferably use an array that's primitive as you can get in your language.

Just a standard 3x3 2D board. Must have complete win & restart functionality, along with a quit.
Bonus points for having a computer player.


Good luck :)
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 12:28:36 am
Arrays have always been my downfall. Even in gmod. Grumpy tried to teach me but i just herp derp everytime.

After work experience tomorrow i'll get working on it straight away.

So you don't expect the actual game to be in text, it can be in a plain image right?
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 25, 2010, 12:30:30 am
No, in text.
Consoles don't do images ;)


But there's nothing stoping you from an ASCII board


eg:
Code: [Select]
O| |X
-----
 |O|
-----
X| |X


or:
Code: [Select]
O X
 O
X X

or something like that.
Up to you!
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 12:37:29 am
kk, I'm still quite confused over how I'm meant to use arrays. I could easily do this with if statements, but when I try put arrays into the equation.. I just can't work it out!

I have no idea what i'm meant to be making into an array. The possible wins? Each squares possibility? Or just the outcome of the board?
Title: Re: Good programming language to learn?
Post by: toofast on November 25, 2010, 12:53:53 am
think about it like this.

An array holds x by y data. So for this game you need 3x3, so thats the first thing you need to make. then everytime a user inputs a value you need to update the array, and print it to screen. And yea you are putting the x and o's on the board. Like pyro showed.

On a side note, something interesting to check out is the curses library. its for linux iirc, but there is ncurses for windows. Its basically like making a gui in console window, by printing a buffer to the console, then refreshing it.
Title: Re: Good programming language to learn?
Post by: Xenolightning on November 25, 2010, 01:07:13 am
Gah I hate how C# does multi-dimensional arrays, arrays shouldn't hold "x by y data". Array's should only hold a number of "items" in one dimension. Then you have an array of arrays, or a jagged array in C#. Stupid C# with its redundant code.

Kayne:
I'd suggest learning how to use a basic one dimensional array, eg. Create an array, assign values to varying indexes of an array, have a play around with removing to learn the functionality of arrays.

THEN, you can move onto multi-dimensional arrays, which will probably be what you want in this situation. You don't have to use a multi-dimensional array, you can do it with a one dimension array, but its tidier to use more than one dimension in this case.

And pyro why tictactoe? I want to play some connect4 yo! :D
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 25, 2010, 02:04:34 am
^ Because start simple.
It's the perfect little thing to keep interested parties from becoming disinterested, keep them learning and discovering, and making a neat little game :)

Quote from: Pyromanik;1335414
^ depends. On a number of things, most of all the toolkit being used.
If it's Qt, use Qt designer, it comes with the Qt package.


Glade for GTK apparently.




Quote from: `Kayne;1335434
kk, I'm still quite confused over how I'm meant to use arrays. I could easily do this with if statements, but when I try put arrays into the equation.. I just can't work it out!

I have no idea what i'm meant to be making into an array. The possible wins? Each squares possibility? Or just the outcome of the board?


An array is just a collection of data.





In a way you can think of them as the times tables. Only instead of 3x2, it's 3xtype (where type is like an integer, double, etc).
Perhaps an easier (more visual) way to think of them, is if you think of each array as a set of cubby holes, and each hole has some data in it.


---------------------------------


So I have an array called 'cubbyholes', and it's size if five (size is less relevant to you chaps with your higher level languages, but for tutorial's sake, it's size is five).

  cubbyholes = [ ] [ ] [ ] [ ] [ ].

There is nothing in any of my cubbyholes.
I want to put something into the third cubbyhole, so I access it and put something in there. A book (b).

  cubbyholes = [ ] [ ] [b] [ ] [ ].

I'll put a pen (p) in the first one, and a CD (c) in the second one.

  cubbyholes = [p] [c] [b] [ ] [ ].

Now I want to put my apple I bought for lunch, but I don't want to get ink on it, have it leak applejuice on my books, or get it mixed up with computer junk. I'll put it in the last one.

  cubbyholes = [p] [c] [b] [ ] [a].

Now imagine, just for demonstration's sake, that we live in the future. We have nifty interdimensional storage, like in that movie UltraViolet.

I want to store an array of stuff in my last cubbyhole. Say for arguements sake that I have 3 more things to put in storage. T-shirts socks and pants. I need 3 more holes.
I'll make an array of 3, and call it clothes.

  clothes = [t] [s] [p].
   cubbyholes = [p] [c] [b] [ ] [a].


Now I'll put that array of clothes into my cubbyholes.

  cubbyholes = [p] [c] [b] [[t][s][p]] [a].

An easier way to visualise this would be in 2 dimensions:

Code: [Select]
[p] [c] [b] [t] [a]
      [s]
      [p]




In hard typed languages, all contents of an array must be the same. So you can only have an array full of integers, not integers and doubles and whatever else you want to put in there. You can get around this, but it goes beyond the scope of my explanation (encapsulating with objects). I'm not sure what kind of typing C# or Python has, but I imagine hard and soft respectively.





Now imagine you have an array, size three, containing size 3 arrays.
I think you can figure the rest out ;)




Does my insomnia help you?
Title: Re: Good programming language to learn?
Post by: Xenolightning on November 25, 2010, 03:27:24 am
But, but, but I wana play Connect4 :<

^ Good explanation of arrays.

C# has two data structures for Multidimension arrays. What they call multidimension is created by int[,] or int[,,] for 2d, 3d etc... and they have another type of array called a jagged array (the multidimensional explained above) which is the good ol' int[][] etc... Both are restricted to the type given at construction, so it seems to keep the same format as other similar languages.

Jagged Arrays >>>>> Multidimensional, but they're a pain to set up because you need to create EVERY CELL in the array, so a massive amount of overhead at creation of the object. But they're easier to loop around, so the advantages soon stack up when you are doing a lot of searching through arrays, they're also slightly faster because its not limited to the method invocations of the multidimensional array.

I got bored, and also suffer from insomnia ;-) So I made a sample solution. two reasons for not giving code 1) I don't want to give the answers away :P 2) The code is terriblly hacky, everything is static, the code is pretty much the quickest solution I made to work :P
Title: Re: Good programming language to learn?
Post by: toofast on November 25, 2010, 08:30:13 am
Quote from: Pyromanik;1335451
Quote from: Pyromanik;1335414
^ depends. On a number of things, most of all the toolkit being used.
If it's Qt, use Qt designer, it comes with the Qt package.


Glade for GTK apparently.



Cheers for that, it does sound like gtk. I will have a look today.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 25, 2010, 08:48:53 am
Quote from: Xenolightning;1335453
I got bored, and also suffer from insomnia ;-) So I made a sample solution. two reasons for not giving code 1) I don't want to give the answers away 2) The code is terriblly hacky, everything is static, the code is pretty much the quickest solution I made to work

A strange game. The only winning move is not to play. How about a nice game of chess?
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 25, 2010, 02:01:41 pm
Quote from: toofast;1335471
Quote from: Pyromanik;1335451
Quote from: Pyromanik;1335414
^ depends. On a number of things, most of all the toolkit being used.
If it's Qt, use Qt designer, it comes with the Qt package.


Glade for GTK apparently.



Cheers for that, it does sound like gtk. I will have a look today.

GTK is C, not C++.
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 25, 2010, 02:03:46 pm
Quote from: Xenolightning;1335441
Array's should only hold a number of "items" in one dimension.

...what? I am not familiar with C# so I don't know what you are specificity referring to, but being restricted to one-dimensional arrays would be crippling
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 25, 2010, 02:05:47 pm
Any single array holds a single dimension of data.
Multi-dimension arrays come from making that data more arrays.

Title: Re: Good programming language to learn?
Post by: Bell on November 25, 2010, 02:09:58 pm
Being restricted to 1-D arrays isn't that bad.
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 25, 2010, 02:16:41 pm
Quote from: Bell;1335610
Being restricted to 1-D arrays isn't that bad.

I don't know of a language that restricts you to this
Title: Re: Good programming language to learn?
Post by: Bell on November 25, 2010, 02:28:03 pm
Well some languages just don't give you the syntax to make multi-dimensional arrays.
It's impossible to 'restrict' someone from making multi-d arrays because you can just implement them yourself by creating list of lists.
So when I say restricted to 1D array I really mean syntaxicly restricted.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 25, 2010, 04:19:02 pm
Yeah in C# you can do int[,], or an array of arrays.

imo either way is fine, just whatever suits your style.

Title: Re: Good programming language to learn?
Post by: Xenolightning on November 25, 2010, 05:35:40 pm
Quote from: Spacemonkey;1335655
Yeah in C# you can do int[,], or an array of arrays.

imo either way is fine, just whatever suits your style.
Yea the first way, just seems un-natural especially if you start programming with the likes of C, where such data structures seem (as said before) redundant. There is effectively no difference in creating a 2D array of int[,] or int[][], just the interaction is slightly different.

Also, how is the game strange? lol, I'll give you that its not the best interface, but its tictactoe, and it works "effectively".

Quote from: Bell;1335625
Well some languages just don't give you the syntax to make multi-dimensional arrays.
It's impossible to 'restrict' someone from making multi-d arrays because you can just implement them yourself by creating list of lists.
So when I say restricted to 1D array I really mean syntaxicly restricted.
Yea it seemed kind of weird when I threw together that app, I used an array of arrays of ints, and had issues because I had to initialise them. So I gave in and used their stupid multi-D syntax
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 06:01:01 pm
Just got home from work experience.

I understand what you all have explained, But I don't understand why you would need to, apart from doing something to the whole array of items at once. Why not just make...

string cubbyholebox1;
string cubbyholebox2;
string cubbyholebox3;

if user says so and so, cubbyhole1= shoes

I'm just confused by how its different. It kinda just seems tidier D:

I thought of another use, which really might only apply to gmod, which could add a new line in the array each time it finds a specific object.
Title: Re: Good programming language to learn?
Post by: Bell on November 25, 2010, 06:21:01 pm
Well you pretty much hit the nail on the head putting things into an array makes it easy to perform common actions on them.
Also arrays allow you to easily make a group of common items without having to give each one a name since you can refer to them by index.

Sure when you have 3 objects arrays seem like overkill.
But it is very common in computer programs to have 1000's

It wouldnt be fun typing out

string cubbyholebox1
string cubbyholebox2
string cubbyholebox3
.........
string cubbyholebox1000

Instead we can write
Code: [Select]
string cubbyholdbox[1000]

for int i = 0; i &lt; 1000; ++i do
 cubbyholdbox[i] = new string()
end
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 06:23:27 pm
Quote from: Bell;1335697
It wouldnt be fun typing out.
string cubbyholebox1 all the way to
string cubbyholebox1000 now would it.
But arn't you just as equally typing out

ARRAY [1] [2] [3]...[998][999][1000]?
Title: Re: Good programming language to learn?
Post by: Bell on November 25, 2010, 06:24:51 pm
thats when for loops come in, see above example.

Also doing it by index allows us to make changes to the program easy.
What if after a week we realised we didn't need 1000 strings we only needed 500, in your system we need to delete 500 lines of code.
I can just do this

Code: [Select]
string cubbyholdbox[500]

for int i = 0; i &lt; 500; ++i do
 cubbyholdbox[i] = new string()
end
Title: Re: Good programming language to learn?
Post by: Speakman on November 25, 2010, 06:27:25 pm
<3 for loops
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 06:31:00 pm
Can you explain the syntax a little please Bell?

Trying to understand the first line.

is it saying for when int i = 0, aswell as when i < 500 do so and so
or, is it saying, when int i = 0, or i < 500, do so and so
Title: Re: Good programming language to learn?
Post by: Speakman on November 25, 2010, 06:34:24 pm
first i is the starting condition, second i is the end condition, i++ is increase i by 1 (i.e i +1)


translated, that segment of code is basically

Quote
for every instance of i between 0 and 500, create array segment (or whatever its termed) for that value of i, then add 1 to i and repeat


i hope thats right and understandable, its been a while
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 06:39:56 pm
I understand what you've said, but its confusing that the conditions of the loop are on the same line as (+ 1 to i each time), with no indication of it changing from condition to action.

and, how the hell do i keep the console window open? it always instant closes?

nvm, worked it out :)
Title: Re: Good programming language to learn?
Post by: Speakman on November 25, 2010, 06:50:18 pm
its just how it is for that language. http://download.oracle.com/javase/tutorial/java/nutsandbolts/for.html
Title: Re: Good programming language to learn?
Post by: Bell on November 25, 2010, 06:53:46 pm
ahh sorry for loops are written most of the time in a condensed form like that just to speed up programming.
I'll do it using a while to show you it clearer.

Code: [Select]
int loop_size = 500
int current = 0

while current &lt; loop_size do
  cubbyholdbox[current] = new string()
  current = current + 1
end
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 25, 2010, 07:10:02 pm
I find C infinately easier to read:

Code: [Select]
int i;
char[20] myArray;
for(i = 0; i &lt; 20; i = (i + 2)) {
   myArray[i] = 'a';
}

it will end up looking like this:
(kinda, the operation isn't safe iirc, but for demonstration purposes...)

Code: [Select]
[a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ] [a] [ ]

In a for loop, the first parameter sets the initial values, the second parameter supplies the 'until' clause, and the last one is the action performed after every loop.
In this case, I increase i after every loop by 2. And when it hits fifty, it is no longer less than 50, so the loop code is no longer executed and the program moves on. I make sure I get the correct result by initilising my variable i to 0 in the beginning.
Title: Re: Good programming language to learn?
Post by: Bell on November 25, 2010, 07:12:52 pm
my pseudo code here is some weird mix between C and lua :p
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 25, 2010, 07:19:07 pm
Quote from: Bell;1335722
my pseudo code here is some weird mix between C and lua :p

Oh, I C xD


Quote from: `Kayne;1335692
Just got home from work experience.

I understand what you all have explained, But I don't understand why you would need to, apart from doing something to the whole array of items at once. Why not just make...

string cubbyholebox1;
string cubbyholebox2;
string cubbyholebox3;

if user says so and so, cubbyhole1= shoes

I'm just confused by how its different. It kinda just seems tidier D:

I thought of another use, which really might only apply to gmod, which could add a new line in the array each time it finds a specific object.

Hmm.
Time for another analogy.
Probably a bad one, because if you're anything like me, you don't. But the concept is there.





Do you put your clothes in a drawer to keep them tidy?
All t-shirts in one draw, all shorts in another...
You know where they all are. You probalby know what order they're in, since you put them in there. So you can just go grab the one you want.

Or, you can keep them strewn all around your bedroom like I do and spend 10 minutes in the morning trying to find a freak'n clean shirt to wear.




Lets say you had a pile of shirts you need to iron.
You can't manipulate variable names on the fly, so you can't go:

(shirt + i).iron();

You'll forever be going:
shirt1.iron()
shirt2.iron()
shirt3.iron()

etc.

With an array, you can iron the lot easily with a loop.

It's a much cleaner, neater, easier to maintain piece of code.
Title: Re: Good programming language to learn?
Post by: toofast on November 25, 2010, 07:49:37 pm
Quote from: Pyromanik;1335604
Quote from: toofast;1335471
Cheers for that, it does sound like gtk. I will have a look today.

GTK is C, not C++.


Well there seems to be references to gtk in creating the menus etc. Maybe its a c++ file with c code in it.
Code: [Select]

//the menu:
m_refActionGroup = Gtk::ActionGroup::create();
//file menu:
m_refActionGroup-&gt;add(Gtk::Action::create(&quot;FileMenu&quot;, &quot;File&quot;));
m_refActionGroup-&gt;add(Gtk::Action::create(&quot;FileQuit&quot;, Gtk::Stock::QUIT), sigc::mem_fun(*this, &Gui::on_quit));
//view menu
m_refActionGroup-&gt;add(Gtk::Action::create(&quot;ViewMenu&quot;, &quot;View&quot;));
m_refActionGroup-&gt;add(Gtk::Action::create(&quot;ShowGraphs&quot;, &quot;Graphs&quot;), sigc::mem_fun(&graphs_window, &GraphsWindow::Show));
m_refActionGroup-&gt;add(Gtk::Action::create(&quot;ShowGPS&quot;, &quot;GPS Plot&quot;), sigc::mem_fun(&gpswindow, &GPSWindow::Show));
m_refActionGroup-&gt;add(Gtk::Action::create(&quot;Options&quot;, &quot;Program Options&quot;), sigc::mem_fun(&parameterswindow, &ParametersWindow::Show));
m_refActionGroup-&gt;add(Gtk::Action::create(&quot;StageWindow&quot;, &quot;Create Stage Window&quot;), sigc::mem_fun(*this, &Gui::on_create_laser_display));

//datalogging menu:
m_refActionGroup-&gt;add(Gtk::Action::create(&quot;LogMenu&quot;, &quot;Logging&quot;));
m_reflog_data = Gtk::ToggleAction::create(&quot;EnableLog&quot;, &quot;Log Data?&quot;);
m_reflog_data-&gt;set_active(true);
m_refActionGroup-&gt;add(m_reflog_data, sigc::mem_fun(*this, &Gui::on_log_data_clicked));
m_refstart_new_log = Gtk::Action::create(&quot;RestartLog&quot;, &quot;Start New Logfile&quot;);
m_refActionGroup-&gt;add(m_refstart_new_log, sigc::mem_fun(*this, &Gui::on_log_data_clicked));
//help menu:
m_refActionGroup-&gt;add(Gtk::Action::create(&quot;HelpMenu&quot;, &quot;Help&quot;) );
m_refActionGroup-&gt;add(Gtk::Action::create(&quot;HelpAbout&quot;, Gtk::Stock::HELP), sigc::mem_fun(*this, &Gui::on_help) );

m_refUIManager = Gtk::UIManager::create();

I can handle some of the code, but i am sure he didn't create the whole thing from some text editor.

I mean heres some text box code
Code: [Select]
TextBox::TextBox(string name) : m_clearbutton("Clear") {
set_label(name);
set_size_request(270,1);
add(m_box);
m_box.pack_start(m_scrolledwindow);
m_box.pack_start(m_clearbox, PACK_SHRINK);
m_clearbox.pack_start(m_clearbutton, PACK_SHRINK);
m_clearbutton.signal_clicked().connect(sigc::mem_fun(*this, &TextBox::on_clearbutton));

//only show the scrollbars when they are necessary:
m_scrolledwindow.set_policy(POLICY_AUTOMATIC, POLICY_AUTOMATIC);
m_textview.set_editable(false);
m_scrolledwindow.add(m_textview);
m_reftextbuffer = TextBuffer::create();
m_textview.set_buffer(m_reftextbuffer);
//for scrolling to the bottom:
m_mark = m_reftextbuffer->create_mark(m_reftextbuffer->end(), false);
}

void TextBox::AddText(string const& text) {
m_reftextbuffer->insert(m_reftextbuffer->end(), text);
m_textview.scroll_to(m_mark);
}
void TextBox::on_clearbutton() {
m_reftextbuffer->set_text("");
}

While i can figure out what is doing, I am not sure how I will add more things to this structure in a text editor without spending a lot of time. So hopefully someone here can make some head way into this.
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 07:51:20 pm
is tic tac toe meant to be 2 player or have a computer ai
Title: Re: Good programming language to learn?
Post by: Bell on November 25, 2010, 07:56:24 pm
tic tac toe is a good wee project to first do some ai on since the search space is so small.
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 08:37:26 pm
/friendrequest

Anyone that I can add to friendlist to get 24/7 help? :P
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 25, 2010, 08:46:33 pm
You are right that arrays are a abstraction. But without them, the language syntax would be much less flexible. In most languages your cubbyhole example would require some sort of for loop with some string concatenation to query every cubbyhole in whatever set, which is much harder than using a numbered array.

The most common application of Arrays is bitmaps. Lets consider a 16x16 picture, with colour, an icon if you will. To store this, we can use a array like int icon [16][16] for instance. We can then draw a icon with 3 small squares in red, green and blue by defining each pixel in code:

Code: [Select]
#DEFINE white 0xFFFFFF
#DEFINE red 0xFF0000
#DEFINE green 0x00FFF0
#DEFINE blue 0x0000FF

icon[1],[1] = white; icon[2][1] = white ; icon[3][1] = white ; icon[4][1] = white ; icon[5][1] = white ; icon[6][1] = white ; icon[7][1] = white ; icon[8][1] = white ; icon[9][1] = white ; icon[10][1] = white ; icon[11][1] = white ; icon[12][1] = white ; icon[13][1] = white ; icon[14][1] = white ; icon[15][1] = white ; icon[16][1] = white ;
icon[2][2] = red ; icon[3][2] = red ; icon[4][2] = white ; icon[5][2] = white ; icon[6][2] = white ; icon[7][2] = white ; icon[8][2] = white ; icon[9][2] = white ; icon[10][2] = white ; icon[11][2] = white ; icon[12][2] = white ; icon[13][2] = white ; icon[14][2] = white ; icon[15][2] = white ; icon[16][2] = white ;
icon[2][3] = red ; icon[3][3] = red ; icon[4][3] = white ; icon[5][3] = white ; icon[6][3] = white ; icon[7][3] = white ; icon[8][3] = white ; icon[9][3] = white ; icon[10][3] = white ; icon[11][3] = white ; icon[12][3] = white ; icon[13][3] = white ; icon[14][3] = white ; icon[15][3] = white ; icon[16][3] = white ;
icon[2][4] = white ; icon[3][4] = white ; icon[4][4] = green ; icon[5][4] = green ; icon[6][4] = white ; icon[7][4] = white ; icon[8][4] = white ; icon[9][4] = white ; icon[10][4] = white ; icon[11][4] = white ; icon[12][4] = white ; icon[13][4] = white ; icon[14][4] = white ; icon[15][4] = white ; icon[16][4] = white ;
icon[2][5] = white ; icon[3][5] = white ; icon[4][5] = green ; icon[5][5] = green ; icon[6][5] = white ; icon[7][5] = white ; icon[8][5] = white ; icon[9][5] = white ; icon[10][5] = white ; icon[11][5] = white ; icon[12][5] = white ; icon[13][5] = white ; icon[14][5] = white ; icon[15][5] = white ; icon[16][5] = white ;
icon[2][6] = white ; icon[3][6] = white ; icon[4][6] = white ; icon[5][6] = white ; icon[6][6] = blue ; icon[7][6] = blue ; icon[8][6] = white ; icon[9][6] = white ; icon[10][6] = white ; icon[11][6] = white ; icon[12][6] = white ; icon[13][6] = white ; icon[14][6] = white ; icon[15][6] = white ; icon[16][6] = white ;
icon[2][7] = white ; icon[3][7] = white ; icon[4][7] = white ; icon[5][7] = white ; icon[6][7] = blue ; icon[7][7] = blue ; icon[8][7] = white ; icon[9][7] = white ; icon[10][7] = white ; icon[11][7] = white ; icon[12][7] = white ; icon[13][7] = white ; icon[14][7] = white ; icon[15][7] = white ; icon[16][7] = white ;
icon[2][8] = white ; icon[3][8] = white ; icon[4][8] = white ; icon[5][8] = white ; icon[6][8] = white ; icon[7][8] = white ; icon[8][8] = white ; icon[9][8] = white ; icon[10][8] = white ; icon[11][8] = white ; icon[12][8] = white ; icon[13][8] = white ; icon[14][8] = white ; icon[15][8] = white ; icon[16][8] = white ;
icon[2][9] = white ; icon[3][9] = white ; icon[4][9] = white ; icon[5][9] = white ; icon[6][9] = white ; icon[7][9] = white ; icon[8][9] = white ; icon[9][9] = white ; icon[10][9] = white ; icon[11][9] = white ; icon[12][9] = white ; icon[13][9] = white ; icon[14][9] = white ; icon[15][9] = white ; icon[16][9] = white ;
icon[2][10] = white ; icon[3][10] = white ; icon[4][10] = white ; icon[5][10] = white ; icon[6][10] = white ; icon[7][10] = white ; icon[8][10] = white ; icon[9][10] = white ; icon[10][10] = white ; icon[11][10] = white ; icon[12][10] = white ; icon[13][10] = white ; icon[14][10] = white ; icon[15][10] = white ; icon[16][10] = white ;
icon[2][11] = white ; icon[3][11] = white ; icon[4][11] = white ; icon[5][11] = white ; icon[6][11] = white ; icon[7][11] = white ; icon[8][11] = white ; icon[9][11] = white ; icon[10][11] = white ; icon[11][11] = white ; icon[12][11] = white ; icon[13][11] = white ; icon[14][11] = white ; icon[15][11] = white ; icon[16][11] = white ;
icon[2][12] = white ; icon[3][12] = white ; icon[4][12] = white ; icon[5][12] = white ; icon[6][12] = white ; icon[7][12] = white ; icon[8][12] = white ; icon[9][12] = white ; icon[10][12] = white ; icon[11][12] = white ; icon[12][12] = white ; icon[13][12] = white ; icon[14][12] = white ; icon[15][12] = white ; icon[16][12] = white ;
icon[2][13] = white ; icon[3][13] = white ; icon[4][13] = white ; icon[5][13] = white ; icon[6][13] = white ; icon[7][13] = white ; icon[8][13] = white ; icon[9][13] = white ; icon[10][13] = white ; icon[11][13] = white ; icon[12][13] = white ; icon[13][13] = white ; icon[14][13] = white ; icon[15][13] = white ; icon[16][13] = white ;
icon[2][14] = white ; icon[3][14] = white ; icon[4][14] = white ; icon[5][14] = white ; icon[6][14] = white ; icon[7][14] = white ; icon[8][14] = white ; icon[9][14] = white ; icon[10][14] = white ; icon[11][14] = white ; icon[12][14] = white ; icon[13][14] = white ; icon[14][14] = white ; icon[15][14] = white ; icon[16][14] = white ;
icon[2][15] = white ; icon[3][15] = white ; icon[4][15] = white ; icon[5][15] = white ; icon[6][15] = white ; icon[7][15] = white ; icon[8][15] = white ; icon[9][15] = white ; icon[10][15] = white ; icon[11][15] = white ; icon[12][15] = white ; icon[13][15] = white ; icon[14][15] = white ; icon[15][15] = white ; icon[16][15] = white ;
icon[2][16] = white ; icon[3][16] = white ; icon[4][16] = white ; icon[5][16] = white ; icon[6][16] = white ; icon[7][16] = white ; icon[8][16] = white ; icon[9][16] = white ; icon[10][16] = white ; icon[11][16] = white ; icon[12][16] = white ; icon[13][16] = white ; icon[14][16] = white ; icon[15][16] = white ; icon[16][16] = white ;

Now, if we only need 8x8 of the 16x16 icon, we can manipulate the array thus:

Code: [Select]
for (int x=1, int y=1, x<8, y<8, x++, y++)
{
print(x,y)
return 0;
}
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 25, 2010, 08:49:05 pm
You should be able to do both (2p & ai) really easy Kayne.
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 08:50:40 pm
Quote from: Pyromanik;1335750
You should be able to do both (2p & ai) really easy Kayne.

Both are easy if my idea of arrays is correct. But I want to talk to someone about this lol, so virus can't steal my ideas. :P

Fine. I'll work out arrays myself then :<

I can't :<
Title: Re: Good programming language to learn?
Post by: Kayne on November 25, 2010, 09:27:29 pm
FUCK YOU MULTI DIMENSIONAL ARRAYS.
Title: Java: FTW!
Post by: Tiwaking! on November 25, 2010, 10:32:13 pm
Quote from: `Kayne;1335762
FUCK YOU MULTI DIMENSIONAL ARRAYS.
Quote from: Tiwaking!;1333600
Five dimensional arrays are your friend

I'll give you some help with the tic tac toe thing, not alot of help since it is in java.
Code: [Select]
JPanel&#91;]squares=new JPanel[9];

for(int i=0;i&lt;squares.length;i++){
squares[i]=new JPanel();
}
Normally I would EXTEND the JPanel to hold a custom picture and call the JPanel's "GamePanel". That way you can use them to hold the player as well so when you check through the played tiles you just need to do a simpley for loop thingy.

Tic tac toe is hard to write, despite what the huge nerds say in this thread. You can give this a go. It was an old alpha version of my flat mates "Keith n Crosses" game so it has alot of bugs the finished version does not.

See if you can figure out how it was made.

http://tiwaking.hostzi.com/keithncrosses/index.html
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 26, 2010, 10:34:04 am
Quote from: `Kayne;1335762
FUCK YOU MULTI DIMENSIONAL ARRAYS.


You can figure them out.
Virus ragequit and played TF2 instead of studying last night, so you've got time (apart from the fact it's not a race... and he's using a different language).

Assuming the language is similar to C, you can access a multidimension array with two (or more) []'s.
Code: [Select]
board[horizontal-index][vertical-index]
Hopefully that helps you visualise it in your head :)





Quote from: Tiwaking!;1335782
Quote from: `Kayne;1335762
FUCK YOU MULTI DIMENSIONAL ARRAYS.
Quote from: Tiwaking!;1333600
Five dimensional arrays are your friend

I'll give you some help with the tic tac toe thing, not alot of help since it is in java.
Code: [Select]
JPanel[]squares=new JPanel[9];

for(int i=0;i<squares.length;i++){
squares[i]=new JPanel();
}
Normally I would EXTEND the JPanel to hold a custom picture and call the JPanel's "GamePanel". That way you can use them to hold the player as well so when you check through the played tiles you just need to do a simpley for loop thingy.

Tic tac toe is hard to write, despite what the huge nerds say in this thread. You can give this a go. It was an old alpha version of my flat mates "Keith n Crosses" game so it has alot of bugs the finished version does not.

See if you can figure out how it was made.

[url]http://tiwaking.hostzi.com/keithncrosses/index.html[/url]


JPanel sounds awfully non-console...
And that's a single dimension array!

Noughts and crosses isn't hard to write. It's more about having the commitment to see it through.
Title: Re: Good programming language to learn?
Post by: AintNoMeInTeam on November 26, 2010, 11:41:47 am
lol, this has made me want to write a naughts and crosses AI that plays optimally *pulls out notes on minimax algorithm*
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 26, 2010, 12:03:31 pm
Quote from: Xenolightning;1335680
Also, how is the game strange?

lol, it was a quote from Wargames, awesome movie.
Title: Re: Good programming language to learn?
Post by: Xenolightning on November 26, 2010, 03:18:39 pm
Quote from: Spacemonkey;1335865
Quote from: Xenolightning;1335680
Also, how is the game strange?
lol, it was a quote from Wargames, awesome movie.
Whooooosh, over and gone for six!
Title: Re: Good programming language to learn?
Post by: Anaraith on November 26, 2010, 04:01:57 pm
Haha you guys are doing my first trimester assignment for scripting. I learnt a bit but not as much as I would have liked cos the tutor didn't know how to teach and instead of explaining what we had to do he would take our keyboards and just write it himself :<

I made it in the end tho :D
Title: Re: Good programming language to learn?
Post by: Spoonguard on November 26, 2010, 04:49:46 pm
a most strange thread. the only way to win is not to post
Title: Re: Good programming language to learn?
Post by: Bell on November 26, 2010, 05:33:04 pm
Sums up internet forums really well.
Title: Re: Good programming language to learn?
Post by: Kayne on November 26, 2010, 05:43:31 pm
okay So i'm trying to work out how to make it that the program will realise strings regardless of their case's (i'm meaning case - sensitive)

But it keeps saying the multi dimensional array is wrong...

people.. just yell at me what i'm doing wrong here :P

Code: [Select]
 public class Variables
  {
    public static string[, , ,] Easy; {{&quot;E&quot;,&quot;A&quot;,&quot;S&quot;,&quot;Y&quot;},{&quot;e&quot;,&quot;a&quot;,&quot;s&quot;,&quot;y&quot;}}
  }


I'm not quite sure how i'ld access this. I was just hoping it would look like this.

Code: [Select]
[E] [A] [S] [Y]
[e] [a] [s] [y]

And I could tell it to look at either the top or bottom lines, and try and match up the word.

btw, I was watching the hitch hikers guide to the universe / galaxy last night, And there was a part that made me think about computers having thoughts. Then I became super keen to program. Does that make me nerdy? :P



EDIT : for some reason, it has a problem with the first curly bracket "{" after "...[, , ,] Easy;..."




Changing the code around abit after some googling, Everything is fine except for each letter, regardless of it being in quotes, gives the error "a nested array initialiser is expected"

Code: [Select]
   {

      public static string[, , ,] Easy = { {E,A,S,Y},{e,a,s,y} };
    }

But, I thought string[, , ,] Easy = WAS the initialiser?
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 26, 2010, 06:47:22 pm
Just do a string.ToLowerCase();

Then match the result of that.


string name = "SpAcEMONkey";

string lowerCaseName = name.ToLowerCase();

Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 26, 2010, 06:51:08 pm
Quote from: `Kayne;1335973
Code: [Select]
 public class Variables
  {
    public static string[, , ,] Easy; {{&quot;E&quot;,&quot;A&quot;,&quot;S&quot;,&quot;Y&quot;},{&quot;e&quot;,&quot;a&quot;,&quot;s&quot;,&quot;y&quot;}}
  }

You only want a 2d array, i.e string[,]

string[, , ,] is a 4d array.
Title: Tic-Tac-Toe: Java, Arrays, Dyslexia
Post by: Tiwaking! on November 26, 2010, 06:59:16 pm
Quote from: Pyromanik;1335849
JPanel sounds awfully non-console...
And that's a single dimension array!
JPanel is a good example since you can put an array on it, so if you want to put, say, 'power-ups' on the squares which are random you can have it calculate that all for you.

Because I have trouble telling left/right and up/down with two dimensional arrays in Java (but not Commodore BASIC), I usually stick with one dimensional arrays of objects, which contain an array. So for tic-tac-toe:
Code: [Select]
public class BoardRow extends JPanel{

JPanel&#91;]lines=new JPanel[3];

}//class
Then have:

BoardRow row1=new BoardRow();
BoardRow row2=new BoardRow();
BoardRow row3=new BoardRow();

OR

Code: [Select]
public class Board extends JPanel{
BoardRow[]rows=new BoardRow[3];
}//class
This way you can keep all the relevant code for working out stuff in the Board and BoardRows.

This isnt how I would personally do it, but its a simple concept.

Quote from: Pyromanik;1335849
Noughts and crosses isn't hard to write. It's more about having the commitment to see it through.
Commitment is the last refuge of the learner and the first stop for huge nerds.


I'd like to help `Kayne, but I spent two hours in class crying, cursing and gnashing my teeth at Visual Studio and C# in general. It took forever to get my cow to shoot milk bottles at a baby.

A huge downgrade from 8-Bit Starcraft.
Title: Re: Good programming language to learn?
Post by: Kayne on November 26, 2010, 07:01:02 pm
Cheers but i'm still not out of the woods yet, based off dificulty i was planning to use an array to list the possible moves that the bot would do...

I can't see how to make the player win.. If i'm going to make a bot I want it to never lose lol
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 26, 2010, 07:04:12 pm
Quote from: `Kayne;1336005

I can't see how to make the player win.. If i'm going to make a bot I want it to never lose lol

Um, you know it's Tic-Tac-Toe right?


It always ends in a draw, unless one player does a stupid mistake.

[video]NHWjlCaIrQo[/video]
Title: Re: Good programming language to learn?
Post by: Kayne on November 26, 2010, 07:15:16 pm
Quote from: Spacemonkey;1336008
Quote from: `Kayne;1336005

I can't see how to make the player win.. If i'm going to make a bot I want it to never lose lol

Um, you know it's Tic-Tac-Toe right?


It always ends in a draw, unless one player does a stupid mistake.

Yeah I know. lol
Quote from: Spacemonkey;1336002
Just do a string.ToLowerCase();

Then match the result of that.


string name = "SpAcEMONkey";

string lowerCaseName = name.ToLowerCase();



Also thanks :)
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 27, 2010, 12:24:35 am
where an inbuilt switch for case insensitive comparison doesn't exist I'd use a regex, but that's because I'm a huge nerd apparently.
Title: Re: Good programming language to learn?
Post by: Bell on November 27, 2010, 12:31:31 am
Yea gotta watch out for those huge nerds.
Title: Re: Good programming language to learn?
Post by: Menial on November 27, 2010, 12:34:54 am
Those small nerds always trying to keep a brother down.
Title: Re: Good programming language to learn?
Post by: Speakman on November 27, 2010, 12:40:44 am
Quote from: Pyromanik;1336094
where an inbuilt switch for case insensitive comparison doesn't exist I'd use a regex, but that's because I'm a huge nerd apparently.

needs more beard tbh
Title: Re: Good programming language to learn?
Post by: Kayne on November 27, 2010, 11:03:35 pm
any reason Why I can't do multiple else if statements?

i.e  if so and so == 1
        mode = 1
    else if so and so == 2
        mode = 2
    else if so and so == 3
        mode = 3
    else Console.WriteLine (">:(")

(That's not my actual code, but it is very similar)

Anything specific I need to do?

Atm, all i did was work around it by going

    if so and so == 1
        mode = 1
    else if so and so == 2
        mode = 2
    if so and so == 3
        mode = 3
    if so and so == 0
        Console.WriteLine (">:(")
Title: Re: Good programming language to learn?
Post by: Bell on November 28, 2010, 01:02:24 am
should be able to do as many else ifs as you want.
What error are you getting?
Title: Re: Good programming language to learn?
Post by: Kayne on November 28, 2010, 01:55:35 am
wtf it suddenly works... Confused...

lol... was probably a tiny syntax error :d
Title: Re: Good programming language to learn?
Post by: Kayne on November 28, 2010, 11:20:36 am
I feel like such a nerd >.< Programming is too fun :P

Umm, Is there any way that I can group a list of functions into one word?

i.e

When I want to do these...

Console.WriteLine();
Console.ReadLine();
if (Console.ReadLine() == "Hey")
   Greeting = "Hey";

Am I able to write...

Greetings test = {
Console.WriteLine();
Console.ReadLine();
if (Console.ReadLine() == "Hey")
   Greeting = "Hey";}

Perform Greetings test
(which would do all those commands)

BTW the reason im' asking instead of googling is because you guys are a lot more clear than msdn is at times :x
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 28, 2010, 11:46:07 am
you can simply make a method

Code: [Select]
public void Greetings()
{
Console.WriteLine();
Console.ReadLine();
if (Console.ReadLine() == &quot;Hey&quot;)
   Greeting = &quot;Hey&quot;;
}

Then call Greetings(); elsewhere in code to run it.


Also, above where you had all your if, else if statements, and switch/case might be more useful.

Code: [Select]
int so = 2;

switch (so)
{
case 1 :
mode = 1;
break;
case 2 :
mode = 2;
break;
default :
Console.WriteLine ("");
break;
}







Title: Re: Good programming language to learn?
Post by: Pyromanik on November 28, 2010, 12:43:39 pm
l2 code tag guys, that's nasty trying to read that, haha
Title: Re: Good programming language to learn?
Post by: Kayne on November 29, 2010, 02:29:27 pm
just to update everyone.

My game is almost finished, all I have to add is the code for the bot to not be an idiot, and allow people to easily line up 3 squares.

(I'll be working on it now, will post when I'm finally finished :D)
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 29, 2010, 03:53:24 pm
Alright, good to hear.

I think I have the next challenge lined up.
It'll be ready when you are :>
Title: Re: Good programming language to learn?
Post by: Kayne on November 29, 2010, 04:55:19 pm
I might take a break for the next challange lol

Theres a few bugs, like your required to type in a square twice (don't just press enter - enter, retype the number.)

But i'm so tired, and i just made garlic bread.

== no effort to fix.

Still open for comments + feedback

I'm sorry I let you guys down.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 29, 2010, 06:34:56 pm
Not at all. You actually made a finish.

***
Urgh I hate you .NET
*You need version 4 of the .NET Framework to run this*
Title: Re: Good programming language to learn?
Post by: toofast on November 29, 2010, 07:37:13 pm
The front of the game looks quite nice. Its good to see you took the time to make an attractive interface.

You should include your code like before. The fact you have to enter in numbers twice is a very weird bug.

Also, pyro, you have failed windows update. It constantly keeps updating my .net framework.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 29, 2010, 08:08:03 pm
Doesn't update if you don't got it installed.
Marked as optional rather than critical, if it's even there at all.

You must also remember that versions 1,2,3 and 4 are all seperate Frameworks.





And after that cryfest:
I've made my challenge in Python.
You will need to install Version 3 of Python to run it (3.1 to be exact).

...Just as soon as I figure out why the fucking board won't reset ><
goddamnit I so just wanna make this in C.
**literally TWO seconds later:
derp derp derp, derpity derp derp: = not == you moran.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 29, 2010, 08:29:02 pm
Python 3.1, dl, clickclick, profit.
Not the tidiest, but that can come later.






Let me know when you're ready for challenge 2 Kayne, we'll do it together again.
(Me taking Virus' place, since he's a short lived fanatic, and I am also just learning Python, since he 'started' it, I thought I should learn it too...)
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 30, 2010, 07:20:11 am
I'm keen for this next challenge, depending on what it is.
Title: GetSome Chess
Post by: Tiwaking! on November 30, 2010, 07:39:57 am
Quote from: Spacemonkey;1336785
I'm keen for this next challenge, depending on what it is.
The next challenge is:

GetSomeChess


Pieces have must have customisable icons. This way you can make the different pieces to be the avatars of people from the forums.

Movement rules are not too important at the moment.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 30, 2010, 09:12:40 am
Challenge accepted.


It will download your avatar from GetSomeforums, based on your profile ID. Now I have to get that chess part working.
Title: Re: Good programming language to learn?
Post by: Menial on November 30, 2010, 09:47:58 am
Yay Kayne, it's good to see the youth of today actually trying do something with themselves.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 30, 2010, 09:56:22 am
This is the result of too many coffee's in the morning.

(http://i3.photobucket.com/albums/y67/jarik/chess.png)

Coming later, actual game play.
Title: Re: Good programming language to learn?
Post by: Speakman on November 30, 2010, 10:18:32 am
i can has castle
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 30, 2010, 11:41:56 am
Here is teh first version.

Unzip to somewhere and run the exe file.

It needs .NET 4, if you played Kayne's game, you should have it.


There are no gameplay rules yet, you can stick a piece anywhere, even on your own ones, and it will kill them.

The instructions at the start tell you how to add people's avatars. Not following the instructions will probably cause it to crash.

Title: Re: Good programming language to learn?
Post by: Kayne on November 30, 2010, 01:18:16 pm
Quote from: Menial;1336823
Yay Kayne, it's good to see the youth of today actually trying do something with themselves.

I love programming lol, It might not show it from my laziness, but yeah. I actually think its fun *nerd*

anyways, chess? Not sure If I can? May have a jab at it tonight :)

btw fuck yeah , pawns are the REAL men in chess.

btw again, Spacemonkey, it seems that if a chess piece kills more than 3 people, then it will blood3 will be dropped when it kills more?
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 30, 2010, 01:22:25 pm
My challenge #2 will have to wait for later I guess :<
Title: Re: Good programming language to learn?
Post by: Kayne on November 30, 2010, 01:24:00 pm
Maybe say the idea anyway? Chess might be a bit too hard for me :O

OH, and you guys like to have source files eh...

Any tips, is appreciated, and usually followed by rep :D

GJ Pyro :>
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 30, 2010, 01:26:57 pm
Ok.

I was going to give you a day or so's grace.



Pyro's Challenge #2:
Take that game you just made (O&X's), and extend it to work on any sized board.
(Obviously superlarge boards will be just supid, but say if you can play anywhere between 3 and 10 length sides...)
This challenge teaches code cleanliness, extensibility and ease of maintenance.
Title: Re: Good programming language to learn?
Post by: Bell on November 30, 2010, 01:28:54 pm
ahh a classic extend the program task, he will be ready to take on uni problems in no time :p
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 30, 2010, 01:29:53 pm
Indeed :>

The cleaner the code, the better you are!
Plus 2D noughts and crosses isn't a hard task. He's done all the game logic...
If he's done it neatly, he'll just have to change a few numbers!
Title: Re: Good programming language to learn?
Post by: Kayne on November 30, 2010, 01:30:09 pm
Wahhh...?
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 30, 2010, 01:31:21 pm
Make your naughts and crosses work on a board of a supplied size (eg 5x5), using the same code you've already written as a base. :>
The board will always be square, so you don't need to worry about accepting 2 numbers, just one.



As a side note... I got an assignment in my second year to implement chess. I never finished it.
I failed that course through my own inaction. Now might be the time to rectify that! :>
Title: Re: Good programming language to learn?
Post by: Kayne on November 30, 2010, 01:52:04 pm
ahh, that's going to be a bit hard.

My code is very messy, as well as specific. Any other projects / ideas that I could try?
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 30, 2010, 02:43:59 pm
Quote from: `Kayne;1336885
btw again, Spacemonkey, it seems that if a chess piece kills more than 3 people, then it will blood3 will be dropped when it kills more?

It just picks it randomly.

I updated it to include notation.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 30, 2010, 03:10:26 pm
Quote from: `Kayne;1336902
ahh, that's going to be a bit hard.

My code is very messy, as well as specific.

That's the point ;D
Title: Chess: The final frontier
Post by: Tiwaking! on November 30, 2010, 03:13:04 pm
Quote from: Spacemonkey;1336826
([url]http://i3.photobucket.com/albums/y67/jarik/chess.png[/url])

This might be more appropriate for the board:
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 30, 2010, 07:16:26 pm
Tiwa can only move diagonally.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 30, 2010, 08:50:50 pm
Quote from: Pyromanik;1336927
Quote from: `Kayne;1336902
ahh, that's going to be a bit hard.

My code is very messy, as well as specific.

That's the point ;D


I'll help you out. It'll be great. You'll learn heaps, and your next program will be easier to achieve! :)

For a start:
Dear Kayne, please write more functions.
Title: Re: Good programming language to learn?
Post by: Virus. on November 30, 2010, 09:00:49 pm
I like how Kayne's the pawn.

I'm not a short-lived fanatic. I have an exam, hense have done nothing and berely read the forums.
Title: Re: Good programming language to learn?
Post by: Pyromanik on November 30, 2010, 10:06:59 pm
mmkay. Steam history says otherwise.
Title: Re: Good programming language to learn?
Post by: Kayne on November 30, 2010, 11:07:02 pm
Quote from: Pyromanik;1337054
I'll help you out. It'll be great. You'll learn heaps, and your next program will be easier to achieve! :)

For a start:
Dear Kayne, please write more functions.

Sounds good :)

If a function is a method, The only reason I didn't use them is because no matter how much I fiddled around with the code, there would always be a syntax errors. That was with the method itself, not when ever I tried to use it (because I never got to use it lol :()
Title: Re: Good programming language to learn?
Post by: toofast on December 01, 2010, 12:09:59 am
A method needs to be outside the main function, but inside the class declaration.

So like
Code: [Select]
namespace WindowsFormsApplication1
{
  static class Program
  {

    /// &lt;summary&gt;
    /// The main entry point for the application.
    /// &lt;/summary&gt;
    [STAThread]
    static void Main()
    {
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);
      Application.Run(new Form1());
    }

    public void method1(int input1, string input2)
    {
      //Do crap
    }
  }
}


Heres a good starting method. Given i have a board of n by n, i want to check if the spot is taken. So i would want a function which takes the position of the spot, and return a bool or int of 1/0 (true/false).

Then make another method, which will be similar to the above, except it places the cross on that spot, and returns nothing (so is of type void).
Title: Re: Good programming language to learn?
Post by: Pyromanik on December 01, 2010, 10:26:38 am
mmm yeah. A function cannot be inside another function.
Unless you're batshit crazy like javascript.
Title: Re: Good programming language to learn?
Post by: Bell on December 01, 2010, 12:34:39 pm
or lua
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on December 01, 2010, 02:25:00 pm
Kayne, you should learn LOLCODE

Code: [Select]
HAI
CAN HAS STDIO?
VISIBLE &quot;HAI WORLD!&quot;
KTHXBYE

or Brainfuck

Code: [Select]
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++
..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

or INTERCAL

Code: [Select]
DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #238
DO ,1 SUB #2 <- #108
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
DO ,1 SUB #7 <- #48
PLEASE DO ,1 SUB #8 <- #22
DO ,1 SUB #9 <- #248
DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #162
PLEASE READ OUT ,1
PLEASE GIVE UP


Title: Re: Good programming language to learn?
Post by: AintNoMeInTeam on December 01, 2010, 07:59:14 pm
Quote from: Pyromanik;1337198
mmm yeah. A function cannot be inside another function.
Unless you're batshit crazy like javascript.

or you use lambda expressions/statements in c#
Title: Re: Good programming language to learn?
Post by: Speakman on December 01, 2010, 09:18:26 pm
lolcode ftw
Title: Re: Good programming language to learn?
Post by: Pyromanik on December 01, 2010, 11:31:55 pm
Quote from: AintNoMeInTeam;1337395
Quote from: Pyromanik;1337198
mmm yeah. A function cannot be inside another function.
Unless you're batshit crazy like javascript.

or you use lambda expressions/statements in c#

Or Python.
But no thanks.
Anyway, not true functions.
Title: Re: Good programming language to learn?
Post by: AintNoMeInTeam on December 02, 2010, 12:15:43 am
Quote from: Pyromanik;1337439
not true functions.

yes they are, you need to check your definition of a function.

and they are crazy useful - just look at LINQ.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on December 02, 2010, 07:27:14 am
Lambda expressions are great. Linq is orsome, I use it all the time now, so useful.
Title: Good Programming Language: Perl is all you need
Post by: Tiwaking! on December 02, 2010, 08:30:23 am
Quote from: Spacemonkey;1337465
Lambda expressions are great. Linq is orsome, I use it all the time now, so useful.
[End of diatribe. We now return you to your regularly scheduled
programming...]
       -- Larry Wall in Configure from the perl distribution
Title: Re: Good programming language to learn?
Post by: Pyromanik on December 02, 2010, 12:55:48 pm
Quote from: AintNoMeInTeam;1337447
Quote from: Pyromanik;1337439
not true functions.

yes they are, you need to check your definition of a function.


Must be different in your language.

Lambda forms can be used wherever function objects are required. They are syntactically restricted to a single expression.
http://docs.python.org/py3k/tutorial/controlflow.html#lambda-forms

Though technically you are correct I guess, semantically they're the same.

Python is also batshit crazy, allowing nested functions :/
I guess most high level scripting languages do.
Title: Re: Good programming language to learn?
Post by: Virus. on December 02, 2010, 05:04:51 pm
Steam times suggest I game for a certain amount of time when I get the time, and any extra is for internet stuff.
Title: Re: Good programming language to learn?
Post by: Pyromanik on December 02, 2010, 06:12:28 pm
Don't panic bro; Everyone with a clue knows that steam often thinks you're playing a game when you're not.
Title: Good programming language to learn?
Post by: Kayne on January 06, 2012, 07:49:07 pm
REVIVE!

So I've decided to pick up programming again, Except this time i'm going to learn actionscript (3?) hurrrr!!!!

Reason being is that my mate is also getting into it. We've had a few ideas for flash games and flash comic shorts.

I am googling around but im' mainly wondering does anyone know actionscript?
Title: Good programming language to learn?
Post by: Emrico1 on January 06, 2012, 09:14:19 pm
I know a little actionscript.

Enough to know that I wouldn't waste any more time on anything flash.
It's based on javascript I think, learn that, much more useful in terms of future commercial use.

You should only need the basics for flash comics either way :D
Title: Good programming language to learn?
Post by: Apostrophe Spacemonkey on January 06, 2012, 09:20:48 pm
Yes, Learn Javascript and HTML5. It's the way of the future.
Title: Oh dear. Flash is being obsoleted
Post by: Tiwaking! on January 06, 2012, 10:54:55 pm
Quote from: Emrico1;1460696
I know a little actionscript.

Enough to know that I wouldn't waste any more time on anything flash.
It's based on javascript I think, learn that, much more useful in terms of future commercial use.

You should only need the basics for flash comics either way :D
As a side note: Javascript has now caught up to Java in terms of speed for certain commands.

I would recommend javascript/html 5 also.

Plus Flash is being obsoleted now.
Title: Good programming language to learn?
Post by: Kayne on January 07, 2012, 12:01:35 am
The basics is all I'm really wanting to learn. For now, Atleast.
Although I do / did plan on making some srs-buisness flash games with 2d water physics etc.

and @Tiwa, Flash is being obsoleted now?
It seems as alive as it's always been, Explain please? :P

Btw guys i'm not planning on doing this for a career, unless there is some data job that requires programming. Every time I ask a electrician in data, they say "Yes theirs programming" but it doesn't seem to be actual code..
Title: Good programming language to learn?
Post by: Apostrophe Spacemonkey on January 07, 2012, 10:00:10 am
Quote from: `Kayne;1460706
and @Tiwa, Flash is being obsoleted now?
It seems as alive as it's always been, Explain please? :P

Flash is still popular, however more and more internet broswers are now on mobile devices, and many don't have Flash. Javascript is standard is all the popular broswers, so if you write an app you know it will pretty much work anywhere.
Title: Programming Languages vs English Language
Post by: Tiwaking! on March 18, 2012, 11:31:20 am
Quote from: Pyromanik;1337549
Must be different in your language.

Lambda forms can be used wherever function objects are required. They are syntactically restricted to a single expression.
[url]http://docs.python.org/py3k/tutorial/controlflow.html#lambda-forms[/url]

Though technically you are correct I guess, semantically they're the same.

Python is also batshit crazy, allowing nested functions :/
I guess most high level scripting languages do.

If programming languages were English accents:
Java would be pidgin English
C# would be Oxford English
Python would be Memespeak.
Title: Good programming language to learn?
Post by: O-L-W-A-G on March 18, 2012, 12:50:18 pm
and VB.net would be American English
Title: Good programming language to learn?
Post by: Pyromanik on March 18, 2012, 01:26:20 pm
Ruby would be Japanese
ASM would be that crazy African language with all the ticks and clicks
C would be latin.
Title: Good programming language to learn?
Post by: O-L-W-A-G on March 18, 2012, 03:09:02 pm
BASIC would be toddlerspeak
Title: GetSome Chess Program is madness
Post by: Tiwaking! on January 17, 2013, 04:05:27 pm
Quote from: Spacemonkey;1336811
Quote from: Tiwaking!;1336788
The next challenge is:

GetSomeChess


Pieces have must have customisable icons. This way you can make the different pieces to be the avatars of people from the forums.

Movement rules are not too important at the moment.
Challenge accepted.


It will download your avatar from GetSomeforums, based on your profile ID. Now I have to get that chess part working.

Are you crazy???

Do you know how HARD it is to program chess? It is ridiculously hard!

I regret even issuing that challenge and would like to smack my younger self upside the head for thinking it would be easy.
En passant uses more booleans than should be allowed.
Quote from: `Kayne;1460706
The basics is all I'm really wanting to learn. For now, Atleast.
Although I do / did plan on making some srs-buisness flash games with 2d water physics etc.

and @Tiwa, Flash is being obsoleted now?
It seems as alive as it's always been, Explain please? :P

Btw guys i'm not planning on doing this for a career, unless there is some data job that requires programming. Every time I ask a electrician in data, they say "Yes theirs programming" but it doesn't seem to be actual code..

Flash is now Adobe Edge (http://html.adobe.com/edge/) which is still essentially Flash, but better.

Not everything is convertible between the too and some recoding is required for some animations. Just a frame timing thing or something. I do not know much about making stuff in Flash.
Title: Good programming language to learn?
Post by: Pyromanik on January 17, 2013, 06:07:57 pm
Nope, Edge Animate is actually just a frontend for working with CSS Animations in a UI.
It's pretty much Dreamweaver without the rest of the internet bits.
It's in it's first version, interface wasn't that intuitive.

Flash isn't compatible because although it's ECMAScript, it's no longer Actionscript. It's Javascript.
Title: One language to rule them all
Post by: Tiwaking! on January 31, 2013, 08:04:17 pm
Quote from: O-L-W-A-G;1475716
BASIC would be toddlerspeak

LISP is king
(http://onefuriousllama.files.wordpress.com/2010/06/lisp-programmers.jpg)
Title: Re: Good programming language to learn?
Post by: Kayne on November 16, 2015, 10:38:55 pm
OH dear god.

Smite me now.

Strike me down with the force of a thousand suns so that I shall never see, speak or hear myself talk like I did... those 3 years ago.

God what a RETARD I was.

Oh, I guess you're only young once.

Now back to business. With my grammar & spelling improved, my brain ever so slightly more matured, I have decided to take up C# again. I have no real reason to play with it other than a keen interest in programming, nor do I have the patience to go through tutorials that seem to use a level of English unbeknownst to me, because, you know, I'm a cheap prick.

But of course, I'm not here to just do a thread revive, I'm also going to be scabby and ask for help.

Using Visual Studio 2k+15, with VISUAL C# (I think the visual part will help me learn faster, as some things are templated)

I'm trying to make a certain calculator, one that finds out the combat (overall) level when you put in what your desired stats are. I know it already exists out there on the internet, but I figured making this for myself will be an easy way to get back in.

Turns out I'm dead fucking wrong. Unholy Lucifer in the spawns of Hell, For what is easy in E2 seems harder than a frozen solid bucket of shit in C#.

I've hit a dead stop just with defining a variable. Getting some honkey ass crap about me trying to make a variable act as a type.

The code in question is this...
Code: [Select]
        private void button2_Click(object sender, EventArgs e)
        {
           public int AttackValue;
            AttackValue =int att.Value
        }

NOW LET US ALL STOP FOR A MOMENT AND LAUGH. LAUGH AT THIS THICK HEADED FOOL FOR TRYING TO MAKE A VARIABLE ACT AS A TYPE. LAUGH AND ENJOY.

God damn, this was supposed to be easy.

What I'm trying to do is, when the button is clicked, values from each NumericUpDown will be grabbed and assigned to a variable relating to that value. So att is the NumericUpDown, where I want to assign the value to AttackValue. Then the values will fall through a simple mathematical formula and set the label property (of a label) to the number that results. I know I'll need to convert it to a string for that to work. One step at a time folks.

But it's not that fucking simple.

Can someone slap me in the face and tell me what I'm doing so ungodly and awfully wrong.

I tried asking Ol' Unc'e Google, but he was drunk and just wanted cuddles and I DON'T KNOW IF I HAVE TIME FOR THAT RIGHT NOW WITH THIS SHIT ON MY MIND.

I bet if I googled the error anyway, All that would come up is a joke about a Value property rejecting someone because

THEY'RE
NOT
THEIR
TYPE.
Title: Re: Good programming language to learn?
Post by: toofast on November 17, 2015, 08:13:18 am
I think your problem is just some missing brackets around the second int. You need brackets around it to typecast it (tell the compiler you intentionally want to store a decimal in a integer variable).

AttackValue = (int)att.Value
Title: Ugh the C# language
Post by: Tiwaking! on November 17, 2015, 08:50:30 am
C# and I are not on speaking terms.
In Java it would be camel case
Code: [Select]
private void btnCalculateValue(){
int attackValue=(int)att.getValue();
}
or even
Code: [Select]
private void btnCalculateValue(){
try{
int attackValue=Integer.parseInt(att.getValue());//for string values
}catch(Exception eek){}//not a number or a string you complete moron
}
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 17, 2015, 09:19:52 am
I look forward to when computers become super intelligent and can program themselves, then they can take over the world and we'll no longer need to program them.

Title: Re: Good programming language to learn?
Post by: Xenolightning on November 17, 2015, 09:42:03 am
You can't specify an access modifier in a method... That's reserved for declaration of fields, properties, methods or events. This isn't a C# "problem" the same technique is used across MANY languages. Should probably read the basics of C# before diving in, then complaining that the incorrect code you are writing isn't compiling.

It's as simple as:
Code: [Select]
public void Method()
{
    int localVariable;
    localVariable = (int) att.Value; //Not sure if the explicit cast is required here, as there is no context.
}

public int .... is reserved for fields in a class, e.g.

Code: [Select]
public class MyClass
{
    public int SomeClassVariable;

    public void SomeMethod()
    {
        SomeClassVariable = 1;
    }
}

Tiwa, why no TryParse? :P

C#
Code: [Select]
int number;
bool isNumber = Int32.TryParse(att.Value, out number);
Title: User Error: Replace User immediately
Post by: Tiwaking! on November 17, 2015, 03:56:14 pm
C#
Code: [Select]
int number;
bool isNumber = Int32.TryParse(att.Value, out number);
I do not write programs to fail by accident.
If they fail, it is the users fault and you should yell at them until they leave the immediate area.
Title: Re: Good programming language to learn?
Post by: Apostrophe Spacemonkey on November 17, 2015, 04:03:07 pm
Here's a tip

Whenever your program throws an error, catch the exception, then initiate the self-destruct process, causing their computer to explode.

Then when they report the problem, ask if they can reproduce the issue.

Set ticket to solved and close.

Title: Android is also horrible
Post by: Tiwaking! on November 17, 2015, 04:09:50 pm
Speaking of shitty programming languages: Do any of you Android programmers know how to get the absolute value of the location of a View? The api methods (getTop(), get Left(), getLocationInWindow(), getLocationOnScreen()) only give the X and Y values relative to the parent.
Title: Re: User Error: Replace User immediately
Post by: Xenolightning on November 17, 2015, 05:40:17 pm
I do not write programs to fail by accident.
If they fail, it is the users fault and you should yell at them until they leave the immediate area.


Code: [Select]
if(!isNumber)
{
    YellAtuser();
}

TryParse is so much nicer than try catch blocks. Code readability > everything.

getLocationOnScreen(), is the correct approach..? Needs to be run after the layout has been performed.

Yuck: http://stackoverflow.com/questions/19497402/get-position-of-imageview-relative-to-screen-programmatically (http://stackoverflow.com/questions/19497402/get-position-of-imageview-relative-to-screen-programmatically)
Title: Re: Good programming language to learn?
Post by: Kayne on November 17, 2015, 09:31:03 pm
Wait, Please correct me here.

Apart from forgetting all the different names, I'm going to try piece together this question...

A method (/function?) is an "operation" that you can call multiple times, right? I could write one out, then keep calling it to repeat that same exact task?
A variable inside that method, can not be accessed outside of that method / function? unless it's a global variable, in which case the variable is set...outside of the function?

I honestly have tried reading the basics. It's just too much information to deal with, I guess. My brain just keeps reading over these words of function, method, class, shell, and what ever other term there is, to describe some sticky process that has great importance.

TL:DR : Everyone seems to use other programming words to explain programming. When I know these words don't mean what I think they mean, It stops becoming fill in the blanks and starts becoming an meaningless paragraph of letters.
Title: Re: Good programming language to learn?
Post by: Kayne on November 17, 2015, 09:33:56 pm
How about this guys.

Start me off with an idea to do. Something extremely basic. I'll get started from there.
Title: Re: Good programming language to learn?
Post by: Xenolightning on November 17, 2015, 09:57:00 pm
A method is a grouping of statements. They are usually created when you have a group of statements that you wish to run in that sequence more than once. There's no guarantee that it will do the exact same thing every time, but only that it will execute the same way**.

Method/Function/Operation/Subroutine, are all interchangeable. In C#, method is the correct name.

**Ignoring conditional branches.. if(...)...

Make something that takes two whole numbers, A and B. Return the result that is equivalent to A^B.

Or try: http://www.learncs.org/en/Variables_and_Types (http://www.learncs.org/en/Variables_and_Types)
Title: Programming Pokemon
Post by: Tiwaking! on November 17, 2015, 10:29:56 pm
How about this guys.

Start me off with an idea to do. Something extremely basic. I'll get started from there.

You have two players. Each player has three cards: Rock, Paper, and Scissors. Each player plays one card. Once both players have played their card the cards are revealed.

The Rock card beats the Scissors card
The Scissors card beats the Paper card
The Paper card beats the Rock card

If the cards are the same then it is a draw.
Code: [Select]
public String getResult(Card card1,Card card2){
String name1=card1.getName();
String name2=card2.getName();
String result="Wins";
if(name1.equals("Scissors")&&name2.equals("Paper"))return result;
if(name1.equals("Paper")&&name2.equals("Rock"))return result;
if(name1.equals("Rock")&&name2.equals("Rock"))return result;
if(name1.equals(name2))return "Draws";
return "Loses";
}
Now: Instead of 'losing' or 'winning', each player does a certain amount of damage to each other until one person runs out of health and dies. Replace 'player' with 'Pokemon' and you're on your way to making Pokemon.

For Xenolightning
getLocationOnScreen(), is the correct approach..? Needs to be run after the layout has been performed.

Yuck: [url]http://stackoverflow.com/questions/19497402/get-position-of-imageview-relative-to-screen-programmatically[/url] ([url]http://stackoverflow.com/questions/19497402/get-position-of-imageview-relative-to-screen-programmatically[/url])

Doesnt work. In fact, it is Wronger than wrong (https://en.wikipedia.org/wiki/Wronger_than_wrong). Essentially it does exactly what it normally does (i.e absolutely nothing) and can never work properly because you need to set it during creation of the layout. Any changes to the layout breaks it. You're better off doing what I originally started doing and just randomly guessing x and y values.
Title: Re: Good programming language to learn?
Post by: Kayne on November 17, 2015, 11:44:51 pm
Make something that takes two whole numbers, A and B. Return the result that is equivalent to A^B.

You don't really need to download it, It's exactly what you said.

But I learnt from doing it and hunger for more.

Now you're going to ask me to give an error, or maybe even prevent someone from typing in any non numeral character.

Here's the code, because I figure you'll want to see how bad I did :>

Code: [Select]
namespace WindowsFormsApplication3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        public Double Variable, Variable2, Result; //Haha fuck you I used a public variable!

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            Double.TryParse(textBox2.Text, out Variable2); // This is the part where you call me an idiot for not using an int
            Result = Math.Pow(Variable, Variable2);
            label1.Text = Result.ToString();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            Double.TryParse(textBox1.Text,out Variable);
            Result = Math.Pow(Variable, Variable2);
            label1.Text = Result.ToString(); // Repeating the two lines probably wasn't needed but I wanted it to auto update.
        }
    }
}
Title: Re: Good programming language to learn?
Post by: Xenolightning on November 18, 2015, 09:47:56 am
Try doing it, when not using a Windows Form application.

Use a console application instead. Using Windows Forms forms (heh) really bad habits.

See if you can do it without Math.Pow too, it's nice to explore and understand how to do something instead of just using something that someone else wrote.
Title: Re: Good programming language to learn?
Post by: Pyromanik on December 07, 2015, 12:33:28 pm
Swift. The next new C killer.
Because no one's tried that before.