Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Poll

What programming topic would you want the next challenge to be about?  (It might be a good opportunity to focus on a subject you're not familiar with or to reinforce knowledge on one that you already know)

Control Flow
- 2 (2.2%)
Arrays, Strings, Pointers, and References
- 8 (9%)
Functions
- 4 (4.5%)
Basic object-oriented programming
- 30 (33.7%)
A bit more advanced OOP (Composition, Operator overloading, Inheritance, Virtual Functions)
- 18 (20.2%)
Templates
- 8 (9%)
Other (Explain)
- 4 (4.5%)
Working with files?  (Streams)
- 15 (16.9%)

Total Members Voted: 89


Pages: [1] 2 3 ... 78

Author Topic: Programming Challenges & Resources (#bay12prog) Initiative  (Read 97508 times)

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia


server:   irc.newnet.net
Channel:  #bay12prog

Suggested Pastebin: http://b12prog.pastebin.com/
Interesting Collaboration tool http://piratepad.net/bay12prog


Welcome!  This is an attempt to help promote what I thought was a good idea for beginning (and not so much) programmers who were looking for a friendly place to seek help, guidance and motivation.

There may be different levels of knowledge regarding programming but what we must never forget is that we are always learning.  To enhance the experience, We can't allow ego around here.  Ego makes us self-conscious about ourselves and limits both our ability to teach and our productivity.  You must be proud of your improvements, but you must let other people walk their natural journey through knowledge.

Most programming knowledge comes from your own investigation of how things work and then trying things out.  Theory is important but it's easier to remember something once you've tested it in the field.  Some say, it's the only way.

When asking a question, it is of extreme importance for the success of the inquiry to consider a number of things wich are explained in a very clear way here:
How to ask questions the smart way

No one here is going to be assigned as an instructor or anything like it.

The point of this innitiative is to be able to help other people progress and learn in the process, have fun and experiment with different concepts and varied ways of doing things.  When you have the opportunity to see different approaches to a specific problem, even if they might not be the most efficient, they might just open your mind a great deal.

For now,  I'll start with some varied challenges (Most might be "borrowed" exactly or slightly modified from other pages and some will be made specifically):

The idea is to serve as a learning and sharing vehicle.

Right now I'm focusing a lot in the c++ language because it's the one I'm more familiar with but the thread and channel should be about anyone you want/need.

As far as the challenges/exercises go... I think that judges are not really a necessity.  In many situations, you'll be able to tell if something worked or not.  But it may be helpful to hand the solutions to a particular person or group of appointed people so that you can get some opinions and insight and, as I said earlier, they will probably learn something else too.

If people want solutions to be shared in a more open way,  it would probably be a good idea, after a certain period of time, to have a spoiler tag with links to solutions in a pastebin (like http://b12prog.pastebin.com/).  So people, after providing their own solution, could proceed to compare and investigate different ideas.

Everything is open to debate.  We can just use the system that we prefer.

The idea of a challenge/contest would be to provide both the challenge and some resources (links, search guidance) needed to learn how to approach the problem.



The following is definetly under construction.  Help me out with the best ones online.  I don't want to just clutter it with all I've seen but try to post the most helpful ones.

Resources:
Language Specific
C++
http://www.learncpp.com/        (As I keep emphasizing in my signature.  A great tutorial site)
http://www.parashift.com/c++-faq-lite/

C
Beej's Guide to C  Allegedly good for pointers and arrays (humor included).

C#
  • MSDN - Blacken suggested this one, excellent documentation on all the standard C# stuff.
  • C# Tutorial - This might be a little bit above the average introductory programming tutorial, but for anyone with some level of programming experience, it's fairly simple.
  • Moving From C++ to C# - A PDF file that covers most of the differences between C++ and C#, fairly thorough.

Java
How to Think Like a Computer Scientist (Java Version)

Python
-How to Think Like a Computer Scientist:Python
-Dive into Python
-
How to Think Like a Computer Scientist (Python)


Ruby
-Try Ruby Seriously right in your browser, it goes over the basic syntax for Ruby as well as some basic commands from a webapp in your browser.
-pickaxe for ruby 1.6, still very relevant
-Learn to Program
Clever Algorithms PhD describes 45 algorithms from the field of Artificial Intelligence.

LOGO
-How to Think.
 
Lua
http://www.lua.org/pil/

Perl
Cpan (giant library of perl modules)
Challenge Sites:
Until I write most of the ones I've thought we can start trying out any of these:
sphere online judge
CProgramming HelpFree Challenges
CProgramming Basic code completion
Some programming challenges I liked in a blog
Programming_Challenges (I just found this one and it looks very interesting)

Lisp
Practical Common Lisp - Free Web Book Version.

Other online judges: http://en.wikipedia.org/wiki/Online_judge

Game Development Related:
Gamedev
Temple of the roguelike
(I've heard good things about this one but I don't particularly know it)

Api/Library Specific:
Win32:
http://www.winprog.org/tutorial/

Graphics:
SDL:
- Add your own.
 
Allegro
  • Allegro CC Manual - An excellent resource, not a tutorial by any stretch, but a great reference material for finding information on the API, among other things.
  • Cpp Game Programming - This website has a pretty good Allegro, introduction level tutorial.  It's where I picked it up.

OpenGl
OpenGl's RedBook (Using GLUT)
Nehe.Gamedev

SFML
Simple and Fast Multimedia Library
Misc
Getting Started With IRC

Web Development
w3schools




Contests will have a code for easy reference.  It's more than likely that the order will be changed.

Challenge 1) CODE: REAL_AGE

Write a program that will ask you for your date of birth and will output your resulting age (Years and months in one hand & total number of days in the other).
Example:
John:  Born: 13/2/1988  (Current date: 21/5/2010)
Result:  "John is 22 years, 3 months old.  He has lived in this world for 8133 days."

What you must Consider: You might do it the hard way... Or you might use a time library.

Challenge 2) CODE: ELLAPSED_TIME.
Write a Macro to measure the ellapsed time of a given function (useful when debugging) 
What you must know: Preprocessor directives.

Challenge 3) CODE: QUADRATIC
B)  Make a program that solves the quadratic roots of an equation of the form: ax^2 + bx + c
specify a,b,c by asking the user each of those numbers in turn. 
What you must consider: http://en.wikipedia.org/wiki/Quadratic_equation[Quadratic Equations.  Divide by zero?  Possible results? 1? 2?

I)  Now make it so that the user can input the equation in the form and you will parse the necessary information.
Take into account the user can write any number of whitespaces in between the plus signs or none at all:
Take into account that one of the numbers may be zero and be ommitted (2x^2 for example would mean a=2, b=0, c=0)
Do it for positive numbers at first.  What do you have to consider for negative ones?
ax^2   +     bx    +c
What you must consider:  Text parsing + everything you did for last exercise.

A)  Extend it to ax^3.  Figure out if you can make it so that the program can analyze and solve an equation input of the way:
3x^2 + 5x + 5x^2 + 1 +   

Challenge 4) CODE: SOURCEPRINT
Write a program such tht it prints its own source code as output.
What you must consider: File input/output

Challenge 5) (By qwertyuiopas): CODE: LASTCHAR
Read in a string as input(any method. Passing on the command line, stdin, file input/output, anything else).
Once the entire string has been input, print the last character, a new line, then the input string, with every third "e" replaced with "ii". Printing the last character prevents the easy solution of "input character, if it is the third e, write ii, else write that character back out.
Output is also your choice, as long as it can be read.(Technically, the "cheating" that can be accomplished with fseek or equivalent on file output would probably require about as much skill as any other solution in a language without strings that automatically resize to fit any added characters.)


I'd like to get some opinions:
  • What type of challenge would you be interested in?
  • Would you like to participate in contests to be forced to follow a time constraint? (should be in a time period where people are not too busy)
  • Any other ideas?

TODO in this thread:
  • Tidy up the contests and organize them depending on the topic.  Organize contests in the 2nd page.
  • Add more contests to cover more subjects.  Make sure the objective is clearly explained
  • Add resources about different languages.  C#, Java, Python, LUA
  • Associate a brief description to each link


Remember:
What this is place is for:
A friendly place to learn and practice various programming subjects without fear of being completely wrong. 
What this place is not for:
No religion wars.  No X is better statements with no backup.  If you want to suggest what you think is a better tool you are allowed to do so but try to show provable advantages and accept calmly any disagreements.  After all, it's just a suggestion.  You're not in the same team at work.
Why B12 and not some other programming forum?
Because, from what I see, there's a lot of people who are honestly interested in programming and hang around here, but sometimes, due to lack of support or guidance they give up or are scared too easyly by what looks like a daunting enterprise.  B12 is a place to have fun and programming can be LOADS of fun.  You don't need to be Newton.  As times goes by, you'll probably want to take upon harder challenges, but, if you do it at your own pace, they will still be entertaining. 

Finally.  I, as you, am human.  So feel free to point any mistake I might've made so I can correct it.
« Last Edit: March 16, 2011, 09:31:34 am by Alexhans »
Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #1 on: May 16, 2010, 11:11:23 pm »

reserved
Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #2 on: May 16, 2010, 11:11:41 pm »

"foundation of being a kickass programmer" list by Blacken.  (proceed at your own risk.  It assumes real knowledge of most programming basics.  Take your time, log your progress)

Web Articles:
Perlin Noise

Hints & Tips:
Redirecting the IO streams.  (Useful to debug test cases)
« Last Edit: May 30, 2010, 08:57:19 pm by Alexhans »
Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.

Mephansteras

  • Bay Watcher
  • Forger of Civilizations
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #3 on: May 16, 2010, 11:45:18 pm »

Looks interesting. I may get in on some of these.

I can also help with perl for anyone who's working with that.
Logged
Civilization Forge Mod v2.80: Adding in new races, equipment, animals, plants, metals, etc. Now with Alchemy and Libraries! Variety to spice up DF! (For DF 0.34.10)
Come play Mafia with us!
"Let us maintain our chill composure." - Toady One

Jookia

  • Bay Watcher
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #4 on: May 16, 2010, 11:50:52 pm »

Ohoohoo this is just my thing. Let me open up GCC and get started. I'm not sure what I'll do yet, though. I'm great with C/C++.
Logged

Alexhans

  • Bay Watcher
  • This is toodamn shortto write something meaningful
    • View Profile
    • Osteopatia y Neurotonia
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #5 on: May 16, 2010, 11:55:53 pm »

Looks interesting. I may get in on some of these.

I can also help with perl for anyone who's working with that.
I'd definetly want your input regarding perl scripts and perl resources.  I just scraped some of the basics of the language some time ago but due to lack of use I don't think I can do anything with it. 

But I've been always interested to see what perl can do using AJAX (Wich Is something I haven't made myself time to test yet) so it will definetly become helpful.
Ohoohoo this is just my thing. Let me open up GCC and get started. I'm not sure what I'll do yet, though. I'm great with C/C++.
I'm glad... Code away. ;)

There are also some resources related to AI I find really interesting and I intent to put in the future.  I'm just starting with it (Finite State Machines, steering) but it's really interesting.
Logged
“Eight years was awesome and I was famous and I was powerful" - George W. Bush.

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #6 on: May 17, 2010, 12:09:17 am »

Awesome thread, Alfie!

I felt like a lot of that was directed at me.
By this time I've decided myself incapable to teach others.
I can answer questions and help out though.

I think I can learn a lot from this thread.
I really need to learn about input/output,
 frame rate, elapsed time, and technical things like that.

I'd be willing to hand out the source for party house,
 but not without writing some notes for it and cleaning it up first.
It might be useful to someone.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream

chaos95

  • Escaped Lunatic
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #7 on: May 17, 2010, 12:12:05 am »

I'm happy to help people in need on here; I'm most reachable in the IRC channel though. If you want a quicker turnaround on any programming questions, I'd recommend you try there.
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #8 on: May 17, 2010, 03:05:45 am »

Add SFML to the Graphics/API libraries. Documentation is sparse, but I've found it to work a lot better than SDL. Also, object oriented.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Dave Mongoose

  • Bay Watcher
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #9 on: May 17, 2010, 05:28:12 am »

I would definitely put a vote in for OOP tutorials/challenges:

It's incredibly important for producing manageable and easy-to-follow code (particularly with large projects), and it's easy to think you understand it when really you don't.


Edit: I'm not sure how easy it would be to write a challenge that tested the methodology, though... Maybe a 'complete the source code' challenge, where the OO framework is already there?
« Last Edit: May 17, 2010, 05:33:41 am by Dave Mongoose »
Logged

ILikePie

  • Bay Watcher
  • Call me Ron
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #10 on: May 17, 2010, 07:42:20 am »

I do some C Sharp here and there, I'd love to try and help with that. This is a nice place to start with any of Microsoft's languages, though it won't get you very far.
Logged

darius

  • Bay Watcher
  • ^^
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #11 on: May 17, 2010, 10:27:54 am »

I suggest adding ide's (for c++): codeblocks and/or MSVS (both AFAK free), but for codeblocks please please please use nightly (from forums or wait for new stable ver)

As for compiler i'm using TDM GCC, works better , is debugged better (then GNU GCC).

Btw my favorite C++ site: http://www.cplusplus.com/reference/
Also good for advanced coders: http://www.parashift.com/c++-faq-lite/ has more "what not to do" but is veery good
Edit: yes i am blind...
« Last Edit: May 17, 2010, 10:33:12 am by darius »
Logged

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #12 on: May 17, 2010, 10:30:06 am »

As for compiler i'm using TDM GCC, works better , is debugged better (then GNU GCC).
Same.

Outcast, a tip, you may want to look at SFML if you ever move Cloudscream beyond glut, instead of SDL.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #13 on: May 17, 2010, 10:47:20 am »

...
Challenge 4) CODE: SOURCEPRINT
Write a program such tht it prints its own source code as output.
What you must consider: File input/output
..

Advanced variation: Quine. In plain terms, do not use file access but represent the code in itself, so all that you need is the compiled program.
See here.
Logged
Eh?
Eh!

Outcast Orange

  • Bay Watcher
  • [SOMETIMES_SQUID]
    • View Profile
    • The Outcast Orange
Re: Programming Challenges & Resources (#bay12prog) Innitiative
« Reply #14 on: May 17, 2010, 11:21:42 am »

As for compiler i'm using TDM GCC, works better , is debugged better (then GNU GCC).
Same.

Outcast, a tip, you may want to look at SFML if you ever move Cloudscream beyond glut, instead of SDL.
I'll keep that in mind, friend.

I found this really useful:
http://augustcouncil.com/~tgibson/tutorial/index.html

Consider adding it to the list.
Logged
[7:53:55 PM] Armok, why did you demand that I don't eat you?
[7:54:34 PM] [Armok]: woooooo

Burried Houses - Platform Explorer Demo H - Cloud Scream
Pages: [1] 2 3 ... 78