Follow Slashdot stories on Twitter

 



Forgot your password?
typodupeerror
×
Programming Technology

Short Coding Projects? 122

sapped asks: "Whenever somebody advocates a new programming language for you to try, they will usually suggest writing something in it that will take you an hour or two to code, so that you can get a feel for it. My problem is that I tend to go from extremely trivial ideas straight to stuff which will keep me busy, for at least a few days. I don't seem to have a handy in-between size project that I can test stuff in. The closest I came to this was writing a little ad-blocking proxy for my browser, a few years back. Any ideas on neat small non-trivial projects?"
This discussion has been archived. No new comments can be posted.

Short Coding Projects?

Comments Filter:
  • by arcanumas ( 646807 ) on Saturday October 30, 2004 @02:04PM (#10673575) Homepage
    There are lots of things you can write in two hours man!!
    voice recognition software, compilers, parser generators , browsers , OS kernels etc etc.
    Come on, be creative... :)
    • ah, no trivial ?

      sorry ...
    • by lostchicken ( 226656 ) on Saturday October 30, 2004 @02:20PM (#10673674)
      I know you were kidding, but a parser generator really can be written in a couple of hours with a logical programming language like Prolog.

    • Compilers and parsers have actually been written in 2 hours... ...for the Obfuscated C contest. So while they can be written in 2 hours and they work, you can't READ them in a million years.
  • a little easy but... (Score:4, Interesting)

    by coolhoot2447 ( 726785 ) on Saturday October 30, 2004 @02:07PM (#10673593) Homepage
    I usually start of with implementing some simple math related things. For example, a prime number generator or a program to calculate pi. The algorithms that you can use to write such a program tend to be heavily documented so you don't have to worry about the design and can concentrate on the implementation in that specific language.
    • by ddewey ( 774337 )
      Or how about graphing fractals? My personal favorite is the Mandelbrot Set [ddewey.net].
    • by saden1 ( 581102 ) on Saturday October 30, 2004 @02:48PM (#10673865)
      you can always got to Topcoder [topcoder.com] and check out some the problems they have over there. They have all sorts of coding problems with varying difficulties.
    • ...or a program to calculate pi.

      Funny you should mention that. The first code I ever wrote in C was PiHex [cecm.sfu.ca] (a distributed project computing project, back in the days before those became cool, which computed the 5 trillionth, 40 trillionth, and quadrillionth bits of Pi. All of them were zero.)
    • by zuzulo ( 136299 )
      Some of the older languages have what they used to call 'finger exercises' or 'idiom lists' which are basically a long lists of small algorithms you can implement to get a very deep feel for a new language. I know idiom lists exist for APL, k, perl, and similar things likely exist for whichever language you are interested in learning.

      It might be helpful if you were to mention which particular language you were currently trying to master, however. ;-)
      • Do you have pointers such lists?
        • Ok, a few pointers - unfortunately the ones I am familiar with offhand are fairly academic languages. And now that I look for them, it appears that other languages do not provide the same sort of lists of 'training problems'.

          Therefore, a great way to learn a language that would also help others would be to take the k language idiom list and build a similar one implementing the problems in whatever language you are trying to learn. Maybe even post the resulting idiom lists for various languages on sourcefor
    • I usually start off by writing mad lib programs. Take input, print output.
    • Yep. little math bits are a good choice because typically I/O programming [which tends to be steep learning curve in a new lang.] is, or can be minimal. and though its certainly a trivial exercise, one of my favorites was to type in an infinite loop Fibonacci number generator...its as small a program as you can write that lets you find out how the language handles printf, arrays and arithmetic overflow for integer types.
  • by selfsealingstembolt ( 590231 ) <markus AT sablatnig DOT net> on Saturday October 30, 2004 @02:23PM (#10673697) Homepage
    Try to get your hands on some programming exams. The programs there are usually designed and written within one or two hours (to fit into a typical lesson). Also they touch all subjects that are of interest in your case, for example the 8-queen-problem for recursion, simple algebra (prime numbers) for number handling, pointers, etc without going to deep into details not necessary if you are not writing productive software.
    • Definately a good suggestion.

      I remember my VB class and the lessons were mostly "type exactly what is shown in the book and press run" but the tests were writing programs that had enough functionality to write and test and be sure that everything worked right but were designed to be done in a shorter period of time.

      Consequently, they were not useful at all...what good is a homemade text editor that consists of a toolbar for save/open/new/font and the standard VB text box.

  • open ended (Score:2, Informative)

    by MikeRepass ( 199982 )
    My suggestion is not to focus on a particular problem -> solution, but to think more open-ended. In essence, think of some general functionality that can be continually extended. Maybe an example will help clarify :)

    When I taught myself python, I first wrote a program that determined the word-wrap properties of a text file. It detected wrapping behavior across lines, and then constructed a range of possible wrap settings. I then added tabwidth detection. After this, I began to think about interpreting t
  • by xanderwilson ( 662093 ) on Saturday October 30, 2004 @02:41PM (#10673825) Homepage
    Or War (the card game), or a slightly more complex turn-based card game.

    Or, if you're terrible at programming or the programming language or compiler sucks, "Hello World!" might take a few hours.

    Alex.

    • Games are good. I usually code up a short (9 or 10 room) text adventure...nothing overly complicated, but something that usually can use objects, pointers, functions, i/o...test out a bunch of different features.
  • RPN Calculator (Score:5, Insightful)

    by readams ( 35355 ) on Saturday October 30, 2004 @02:50PM (#10673874)
    A friend of mine suggested a reverse-polish notation caclulator. It's a pretty good project since you'll have a chance to use a common data structure (stack) along with all the basic features of the language.
  • What I do... (Score:5, Interesting)

    by NetNifty ( 796376 ) on Saturday October 30, 2004 @02:51PM (#10673883) Homepage
    What I do first of all after the basic "hello world" examples and stuff when learning a new language is a simple "guess the number" game - computer randomly generates number between 1 and 100.

    User then guesses, and computer replies if the guess is higher or lower until number is guessed. Teaches use of loops, random number generation, text input & output etc. Can also go on to store lowest number of guesses in "high score" table etc, or use TCP to make it playable over telnet, if you so wish.
    • Funny you say that I did the same thing when learning perl.

      Keeping just one high score, my nephew and niece played it for at least 2 hours.
      I couldn't believe it.
  • My issue (Score:2, Funny)

    by robotoil ( 627969 )
    My issue is not that I can't think of anything to write, but that I have writers block.
  • Or any other simple game.

    Nim would work nicely also.

    Once the basic two human player version is done you can have them add a simple ruleset to let the computer play the game.
    • That's exactly what i do usually. Small games, Tic Tac Toe has even been one of them. Other games i did where Space Invaders (with circles attacking-didn't do sprites), Backgammon, a worm game, a wizard of war clone (that one took me longer than expected), mastermind (that was too short). Programming small games is great for learning something new, as you can usually put in the things you like to learn. You can use Graphics, Sound, Menüs, Fileoperations, Inputdevices, Parsers and so on.
    • Funny you should mention that as I just did a tic-tac-toe version. I didn't teach it how to play - just the basic rules. I then saved each game to disk and allowed the program to learn how to play from this history. After about 60 games it started playing "properly" and after about 90 games I could no longer beat it.
  • Because it's fun, and the knowledge might save your ass some time in the dystopian future.
  • Couple I've done (Score:5, Interesting)

    by jbester1 ( 551491 ) on Saturday October 30, 2004 @03:20PM (#10674099)
    Something simple like a basic Webserver (GET/PUT/HEAD) or a FTP server.

    You get:

    a) simple string parsing/processing/manipulation
    b) File I/O and filesystem manipulation
    c) Network I/O

    Optionally or language dependent:

    d) Threading
    e) Packaging

    If a dynamic language (e.g. lisp):

    f) Write something like JSP on top of it: dynamic dispatch to handling method/function

    Optimizations are easy as well. Caching will give you a good overview of data structure speed.
    • I was going to say the same thing. A basic multithreaded HTTP server is perfect for learning a new language. Of course, if you're trying to learn a functional language, this will be either impossible or at best a real pain, so don't. I haven't seen a web server written in Lisp yet, but I don't think I would want to even if it could be done.
      • by Anonymous Coward
        Lisp is a multiparadigm language, not a pure functional one. Mature web servers written in lisp have existed for years, and are typically not written in a functional style. AllegroServe and Araneida are probably the big two (they have different focuses, think apache vs. zope). http://www.cliki.net/Web [cliki.net]

  • by Anonymous Coward on Saturday October 30, 2004 @03:21PM (#10674111)
    A random idea generator?
  • I'd still consider that a trivial problem. Things don't start getting interesting until you are dealing with Staff Years to develop them. Anything under that and you can actually keep the full design in your head
  • Card games, some sort of parser, math tools, maybe a text-based web browser. Think back to some of your CS 101 days.
    • oh man, i dont know where to start. Computer science, i took CS1 last year, the first year of Java for my teacher. Thus, we were learning it with him, at a slightly faster rate (he'd assign stuff he didnt know how to do, forcing us to buy books and google) Anyway, here I am now in CS2-AP, and we still dont know jack. This year (11 weeks or so in) we've only programmed 1)Dots and Boxes 2)EtchaSketch and 3)some crappy file reader. We could do Tic-Tac-Toe, but it would take alot longer than 2 hours
  • by Futurepower(R) ( 558542 ) on Saturday October 30, 2004 @04:01PM (#10674338) Homepage

    Here's a simple program that would benefit the whole world:

    Make a program that shows what parts of a huge folder fit on individual CDs or DVDs. The output of the program would say, for example, that all the files from sub-folders A to Information would fit on the first CD, and all the files from sub-folders Installers to Netgear would fit on the second CD, and so on.

    It is necessary to store backup sub-folders in alphabetical order on the backup CDs or DVDs because then they can be found easily.

    Right now there is no good way to decide how to apportion the data. Breaking any file into two pieces just causes problems later, so the Easy CD Creator method does not work well.

    Later, it would be excellent if the program made .ISO files, of course, and even more excellent if the program asked the user to insert a CD or DVD, and burned the media.

    --
    100 Facts and 1 Opinion -- The Non-Arguable Case Against the Bush Administration [thenation.com]
    • Re: BTTB (Score:2, Interesting)

      by Tolomak ( 173813 )
      For its own benefit, the world should give Burn to the Brim [sourceforge.net] a try!

      • Burn to the Brim does not work the way I described. When I last checked it, there was no way to put the files in alphabetical order. That makes them difficult to find. There were other problems, too. I wrote to the author, but he did not want to make changes.
    • Make a program that shows what parts of a huge folder fit on individual CDs or DVDs. The output of the program would say, for example, that all the files from sub-folders A to Information would fit on the first CD, and all the files from sub-folders Installers to Netgear would fit on the second CD, and so on.

      It is necessary to store backup sub-folders in alphabetical order on the backup CDs or DVDs because then they can be found easily.


      As described, there's a major problem with your algorithm for decidin

      • we're paying 14 cents for CDs now. We don't care if some space is wasted. Also, for many data sets, there are no huge files. We have about 5.8 gigabytes of miscellaneous software that we and our customers may need. We don't put anything over 50 Megabytes on the hard drive.

        Burn to the Brim doesn't work well when you need one single file from 110,000 small files. It could be on any one of the backup media. There is nothing wrong with my proposed algorithm for that kind of data set.
  • by Andreas(R) ( 448328 ) on Saturday October 30, 2004 @04:05PM (#10674364) Homepage
    How about solving NP-problems in polynomial time? That should keep you busy for a few hours.

    • NP problems are solvable in polynomial time.

      NP encyclopedia entry [wikipedia.org].
      • Some NP problems are solvable in polynomial time. NP-complete problems, which the parent was probably referring to, are currently not.
        • by Anonymous Coward
          They're solvable in polynomial time with a
          NONDETERMINISTIC TURING MACHINE. Creating one of
          those would be a nice project.
          • No, you're confused and still thinking of NP-complete problems. NP problems and NP-complete problems are quite different.

            NP: problems whose solutions can be VERIFIED to be correct in polynomial time (as opposed to exponential time or some even faster-growing function of time). NP includes all trivial problems which can be solved in constant or linear time, since constants and linear functions are low-order polynomials. No non-deterministic turing machine is required to solve those.

            P: problems whose so

    • by Anonymous Coward
      Or coding an algorithm for generating Slashdot humor. Actually, that might be trivial.

      1. If the question is for something that is easy, suggest something that is hard.
      2. ???
      3. Laugh!

      Yeah, real funny. Sheesh.
  • IRC bot (Score:5, Insightful)

    by Tobias Luetke ( 707936 ) on Saturday October 30, 2004 @04:39PM (#10674559)
    I implement a simple irc bot in whatever language i test. Usually takes few hours and you can write it as top down script or as oop monster, up to you.

    The good thing is that you can use this irc bot to test just about every aspect of the language later on. Its not a project which is just done and discarded. Possible enhancements are user recognition or even something fancy like cvs commit reporting.

    For example when i decided to play with sqlite took the ruby version of the bot and added a funny quotes database.
    • Like this: [bash.org]

      <Zybl0re> get up
      <Zybl0re> get on up
      <Zybl0re> get up
      <Zybl0re> get on up
      <phxl|paper> and DANCE
      * nmp3bot dances :D-<
      * nmp3bot dances :D|-<
      * nmp3bot dances :D/-<
      <[SA]HatfulOfHollow> i'm going to become rich and famous after i invent a device that allows you to stab people in the face over the internet

  • Gravity (Score:3, Interesting)

    by Mawbid ( 3993 ) on Saturday October 30, 2004 @04:55PM (#10674656)
    I've written variations of this [gagarin.is] in a few languages. This small example exercises classes and operator overloading, collections and iteration, math, graphics, modularization, so it gives a pretty comprehensive view of what the programming system is like in real use. But the real reason I like it is because the output is mesmerizing.
  • The game Mastermind. The computer chooses a random string (generally of colors or numbers), the user then inputs a guess. As feedback, you get a number of black pegs (one token in the right position) and a number of white pegs (one token in the wrong position). The user's guess history should be displayed, and they should try and solve it in a given max number of guesses.

    Gets some simple algorithms, simple data structures to store things in, and a UI of your choosing (can be text only, or graphical)
  • by ReKleSS ( 749007 ) <(mf.liamtsaf) (ta) (sselker)> on Saturday October 30, 2004 @05:19PM (#10674777)
    My preference is the OSIX [osix.net] GEEK challenges, but anything with decent complexity will do fine. Solve the challenge first in a language you know, then reimplement in the new language. Just note that the first few geek challenges don't require much/any programming skill, and the first one could take a while. Take a look at Hackergames [hackergames.net] for more sites with the same type of challenges.
    -ReK
    • How about the ICFP [luc.edu] contests, which have been featured on Slashdot many times? Entries are usually made for just about every language out there, so there is a good chance that someone else may have already used your language to implement a solution. After working out your own solution, looking at others' solutions could teach you even more about the language.
  • When I wanted to see what Java was all about, I wrote a little ROT13 converter. It was straightforward (simple algorithm), but somewhat useful in that I did not have a converter on my Windows machine at the time. As a bonus, I think I was trying to convert someone's sig on /.

    The nice thing about something like this is that you can extend the project as you learn more aspects of the language. For example, your first try might open an input file and dump the results, with the next version adding code for
  • by Nice2Cats ( 557310 ) on Saturday October 30, 2004 @07:37PM (#10675496)
    I think you need to be a bit more specific about which programming language you are talking about. In Python, a program that lets you write an email with your favorite editor and send it via SMTP is something you can do a few hours; however, in assembler, some of the most easy problems quickly get tricky:

    .file "helloworld.c"
    .section .rodata.str1.1,"aMS",@progbits,1
    .LC0:
    .string "Hello World"
    .text
    .p2align 4,,15
    .globl main
    .type main, @function
    main:
    pushl %ebp
    movl %esp, %ebp
    subl $8, %esp
    andl $-16, %esp
    movl $.LC0, (%esp)
    call puts
    leave
    ret
    .size main, .-main
    .section .note.GNU-stack,"",@progbits
    .ident "GCC: (GNU) 3.3.3 20040412 (Gentoo Linux 3.3.3-r6, ssp-3.3.2-2, pie-8.7.6)"

    Now try doing that without looking up things in a book -- obviously I cheated here and just used the GCC. You see what I mean, though: Writing a mail program in assembler is somewhat more tricky than Python.

  • by Bob Cat - NYMPHS ( 313647 ) on Saturday October 30, 2004 @09:08PM (#10675983) Homepage
    Write a porn collector that will crawl through unlinked collections on free porn sites. I'll bet you've done this by hand already (no pun intended). It will have to figure out the directories and filenames from evidence in the linked parts. You'll be using simple AI and network stuff, but if you also want to look only for redheads, you'll be doing some graphics work too.

    If you use my idea, you should send me some redhead pix. Thank you.
  • If you're that bored and that good at coding, consider become a developer for Debian or one of the BSD projects. I mention these projects in particular because they have very specific membership procedures for accepting new developers and excellent tools to help you document and package your code into new packages. NetBSD is particular really could use some more developers, and the people on the netbsd lists are low-key and friendly. There are also many open source projects for Windows, DOS, MacOS X, and
  • by dtfinch ( 661405 ) * on Saturday October 30, 2004 @11:12PM (#10676577) Journal
    You can try to reproduce some classic arcade games. Many of them are very easy to code in an afternoon.

    Here's an asteroids [mytsoftware.com] clone I wrote in javascript. It renders everything with divs.
  • I usually write a version of a knowledge base (for web apps anyway).
    They're pretty strait forward - a couple of tables and a couple of pages. But they have enough to cover the bases.
  • Two things (Score:3, Interesting)

    by Sludge ( 1234 ) <slashdot@NosPaM.tossed.org> on Sunday October 31, 2004 @03:05AM (#10677396) Homepage
    First, I write a CLI calculator. This gets me understanding simple I/O and type conversions.

    If the language has compelling semantic separation (usually object orientation), I'll write some form of random song guitar tab generator. That's a personal project of interest to me.

    Then I go back to Python.

  • I'm a server guy, so I usually write an HTTP server or an SMTP server. This gives me a feel for how I/O is done in the language, threading, exceptional cases, parsing, regular expressions, etc. Everything a growing boy needs. HTTP and SMTP are pretty simple protocols, and are actually useful to have once you've completed them -- my need for an RPN calculator or an eight queen solver or a wandering ant trail follower or a trainyard simulator or a Pavlov's triangle solver or a Towers of Hanoi seems to be less
  • Two things I have already re-implemented a couple of times, and which are (IMO) easy enough to do in a couple of hours, and good enough to get a feel for a specific language:

    1) Today
    An old program (may had different names on different OSes) that, given the system date, will spew forth a list of things that happened in the past on the same date.

    Tricky part: you can augment its files adding programmable stuff like "on the third sunday of august, show this message" or "if the 4th of October is a Saturda
  • I pretty much ... (Score:2, Interesting)

    by schmu_20mol ( 806069 )
    ...consider the approach Alex Stepanov describes in http://www.stlport.org/resources/StepanovUSA.html [stlport.org] one of my favourites...
    ...And if they cannot implement max or swap or linear search, what chances do they have to implement really complex stuff? These are my litmus tests: if a language allows me to implement max and swap and linear search generically - then it has some potential.
  • by astrojetsonjr ( 601602 ) on Sunday October 31, 2004 @09:27AM (#10678374)
    I teach advanced programming at a local university. I often get students that want to get into the class without having the prior classes. I tell them to set aside 90 mins and to call/email me when they are ready to start.

    For the first hour (or whatever) it takes I have them write a four function calculator (FFC). Once they get that done, I have them extend it to add trig functions like sin / cos in the last 30 mins. If they can't do that, they are not going to be happy with harder assignments.

    I also use this as a mini-test of a new language. Try my new language COAL, better than Cobol, faster than VB, a true OO language with VM's that run on any Timex watch!! A short stint creating a FFC lets me know how well it works out.

    The FFC is also good since you can use it for GUI checkout to see if that new tool rocks as much as Freshmeat would like you to think.

  • Go big (Score:3, Insightful)

    by HeyLaughingBoy ( 182206 ) on Sunday October 31, 2004 @10:03AM (#10678488)
    I'll skirt around your question and instead suggest after you get done with helloworld.lang you go straight to something interesting even if it's huge.

    Why? Well most 1 day projects aren't very challenging or interesting. But most major projects will have subsystems that you can do in one day, and the project in its entirety can hold your attention long enough that you may eventually complete it, by which time you're an expert in the language.

    This is pretty much the approach I had to take to learn C++ and OOP. I started a job knowing only C and the basic ideas of objects, and took on small bits of the C++ project until I could handle larger chunks.
  • Hello World? (Score:2, Insightful)

    by l0rd ( 52169 )
    Hhmmmm....You'd figure somebody would have made this lame remark already.

    But seriously, a good project for learning a language depends on the language itself and the problems you yourself face. You're not gonna write a simple 3d engine in python and you're not gonna write a log parser in C (actually you could, but that wouldn't be the easiest/quickest solution).

    Just pick something trivial that bugs you at any given moment that's the right job for the language.
  • Does anyone know any projects to get one started with c/c++? It doesnt matter which one i'm learning them both at the same time, but most of the above sugggestions involve gui libraries, which are built into some languages like java, but theres really no standard for c/c++. what library would someone suggest learning to be able to start a simple project?
  • Format converters (Score:4, Interesting)

    by retrosteve ( 77918 ) on Sunday October 31, 2004 @01:15PM (#10679470) Homepage Journal
    A serious suggestion --

    Look at your favorite text, sound, or graphic format that you've had trouble converting to or from some other format. Write the converter.

    This can range from 1 hour to a week's work, but it's always instructive and usually fun.
  • Graph algorithms (Score:3, Informative)

    by cakoose ( 460295 ) on Sunday October 31, 2004 @06:14PM (#10681056) Homepage

    Graph algorithms are good for testing out a language's data structures. Dijkstra's single-source shortest path function is a good one to start with.

  • by crazyphilman ( 609923 ) on Sunday October 31, 2004 @07:22PM (#10681482) Journal
    Do "Towers of Hanoi".

    You've got three posts, and up to 64 disks, with the largest disk slid down to the bottom of the first post and the smallest disk at the top, and the diameters of the disks tapering.

    You have to move all the disks from the first post to the third post in such a way that no disk is ever placed on a smaller disk, and only one disk is moved at a time, one post at a time. It's harder than it looks.

    Your goal: model the three posts and the 64 disks. Write a program that moves the disks from the first post to the third via the middle one, without ever violating the rules. Record the sequence, and let it run, finding the shortest sequence that works.

    It's kind of a fun one.

    • While it is a classic problem, I don't see how an implementation of the "Towers of Hanoi" would take more than 5 minutes or be over 10 lines of code.

      How about the Sieve of Eratosthenes, matrix decomposition, or a recursive descent parser? None of these should take more than 20 or 30 minutes.
  • Make a chess game... (Score:4, Interesting)

    by Ramses0 ( 63476 ) on Sunday October 31, 2004 @07:59PM (#10681691)
    I like writing a chess game... there are sufficient enough ways to implement a two-player (human) game, and enough corner cases that it's an interesting problem with well-defined rules. Have fun!

    --Robert
  • Code for others! (Score:5, Insightful)

    by sachachua ( 246293 ) <sacha@@@free...net...ph> on Sunday October 31, 2004 @09:57PM (#10682203) Homepage Journal
    When I'm studying a language, I like finding an open source project I care about and looking for something to tweak. Advantages of this include feedback from other developers, an instant framework to fit your small changes into, and the warm and fuzzy feeling you get when you make something other people will use. You can pick up the idioms of the language quickly by reading code used in real life. Participating in an open source project also connects to a lot of other people who already know the language you want to learn, and you can ask them for help.

    Don't be intimidated by the size of projects. Pick a project, browse through the source code, try to get the feel of things. You can usually find a bug report small enough for you to work on. If not, think of a feature you'd like to have and try to implement it. =)

    Great way to get into a language.
  • I do numerical modelling for process engineering and my first programming exercise with a new language is to write a cubic equation solver based on that in the Numerical Recipies books. This exercises all of the basics, particularly math funtions (square roots, powers and trigenometry) as well as basic conditionals. The resulting code is actually useful in my work - I now have versions in Fortran (the original NR Fortran book didnt actually supply code), C, C++, Java, Tcl, and Python!

    On a related note the
  • Back in the 1970s a little game came out called Master Mind. It's still available today, uses a plastic board and colored pegs. Great game -- except that if the person who creates a puzzle for you to solve makes a mistake in handing out clues, it is very upsetting. So the first significant program I wrote (BASIC) was Master Mind. Keyboard input, graphical output, clue algorithm, etc. Took me about a week, but back then I was just a beginner. NEVER makes a mistaking handing out clues! As years go by a
  • Tetris (Score:5, Informative)

    by marcovje ( 205102 ) on Monday November 01, 2004 @06:51AM (#10684249)

    I usually write a tetris clone.

    Basic operation is 400-1000 lines typically
  • For those that have asked the question. I am currently learning Python. However, I wanted to keep the question general enough so that if I came up against a new language then I would have an "arsenal" of small problems that I could throw at it quickly to tweak out the difficult areas to code in and to highlight the strengths of the language.
  • I one had a coworker who said he always writes an address book as a first project when learning a new language or api. It covers a fairly broad range of stuff--common ui components, collections, sorting, searching, file io, etc--while being conceptually pretty simple.
  • by mahlen ( 6997 ) on Tuesday November 02, 2004 @02:30PM (#10701724) Homepage
    http://pragprog.com/pragdave/Practices/Kata [pragprog.com]

    For the lazy or doubtful, here's the list of descriptions:

    KataOne: Supermarket pricing. Pricing looks easy, but scratch the surface and there are some interesting issues to consider.
    KataTwo: Karate Chop. A binary chop algorithm is fairly boring. Until you have to implement it using five totally different techniques.
    KataThree: How Big, How Fast? Quick estimation is invaluable when it comes to making design and implementation decisions. Here are some questions to make you turn over the envelope.
    KataFour: Data Munging. Implement two simple data extraction routines, and see how much they have in common.
    KataFive: Bloom Filters. Implement a simple hash-based lookup mechanism and explore its characteristics.
    KataSix: Anagrams. Find all the anagram combinations in a dictionary.
    KataSeven: Reviewing. What does our code look like through critical eyes, and how can we make our eyes more critical?
    KataEight: Objectives. What effects do our objectives have on the way we write code?
    KataNine: Checkout. Back to the supermarket. This week, well implement the code for a checkout system that handles pricing schemes such as "apples cost 50 cents, three apples cost $1.30."
    KataTen: Hash vs. Class. Is it always correct to use (for example) classes and objects to structure complex business objects, or couple simpler structures (hash as Hashes) do the job?
    KataEleven: Sorting it Out. Just because we need to sort something doesnt necessarily mean we need to use a conventional sorting algorithm.
    KataTwelve: Best Sellers. Consider the implementation of a top-ten best sellers list for a high volume web store.
    KataThirteen: Counting Lines. Counting lines of code in Java source is not quite as simple as it seems.
    KataFourteen: Trigrams. Generating text using trigram analysis lets us experiment with different heuristics.
    KataFifteen: Playing with bits. A diversion to discover the pattern in some bit sequences.
    KataSixteen: Business Rules. How can you tame a wild (and changing) set of business rules?
    KataSeventeen: More Business Rules. The rules that specify the overall processing of an order can be complex too, particularly as they often involve waiting around for things to happen.
    KataEighteen: Dependencies. Lets write some code that calculates how dependencies propagate between things such as classes in a program.
    KataNineteen: Word chains. Write a program that solves word chain puzzles (cat -> cot -> dot -> dog).
    KataTwenty: Klondike. Experiment with various heuristics for playing the game Klondike.
    KataTwentyOne: Simple Lists. Play with different implementations of a simple list.

    mahlen
  • Use a simple data file format and allow for CRUD operations. Write a network server and GUI clients. Covers file IO, collections/data structures, networking and GUI. Bit boring, mind :)
  • Pick a project from http://www.elance.com/ [elance.com], http://www.rentacoder.com/ [rentacoder.com], or some other freelance platform to test your coding skills. If you have an account, you could even earn some money.
  • Make a program that can determine the exact size, shape, and position of everything in the universe by examining how the atoms in a piece of fairy cake are arranged. While you're at it, bake a fairy cake. And create something capable of measuring every single atom's position in that fairy cake.
  • Last Xmas I got a little puzzle that involved arranging 16 cards, each having one of about 9-10 images on each side so that each image was next to a similar one. (Maybe a wee diagram will help)
    __________
    __|__|__|__|
    __|__|__|__|
    __ | __|__|__|
    __|__|__|__|

    I'd just started learning Java at the time and thought it would be fun to try and solve the puzzle using Java.

    It was great for learning purposes. It required fairly complex logic (a brute force alg would take weeks), used a couple of classes, and also made

E = MC ** 2 +- 3db

Working...