A few ideas, some from my own early education and some thought up

- find the LCD of two natural numbers

- test whether an array of reals is pointwise convergent. Spoiler:

!grep abs( $array[ $_ ] ) < abs( $array[ $_ + 1 ] ), ( 0..$#array- +1 );
- given a five-letter English word, find all two- or more-letter permutations that are present in the dictionary (dictionary file is /usr/share/lib/dict/words).

- write a program for a robot to explore and map an orthogonal maze 40m x 40m. The robot can see one metre in each of four directions North, South, East or West and perceives the presence or absence of a wall. A wall is a one metre cube. The robot receives only the instructions N, S, E and W (to move one metre in that direction). It then returns four binary digits to your program indicating the presence or absence of walls in these directions and awaits further instructions. If the robot is told to hit a wall, it will, but will emergency shut down after that, so the program must not instruct this. The maze has an entrance and an exit which are interchangeable for these purposes. The goal of the program should be to produce a map of any such maze as efficiently as possible. Include an iteration counter and fail at a million iterations to prevent accidental looping of the program. Communication with the robot takes place via STDIN/STDOUT. (advanced version: extend this to N robots exploring the same maze. Robots cannot discern between walls and other robots. In this case messages to and from robots begin with a numeric robot id followed by a space.)

__________________________________________________________________________________

^M Free your mind!


In reply to Re: Simple but thought-provoking programming tasks [OT] by Moron
in thread Simple but thought-provoking programming tasks [OT] by Cody Pendant

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.