Thread: Help getting Ideas on Challenging Programes to write

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Writing a simple interpreter can be a lot of fun.
    Start with a calculator that does arithmetic.
    Code:
    (+ 2 3)
    Add variables
    Code:
    (let (a 5) (+ a 5))
    Conditions
    Code:
    (if (x > 5) (+ x 1) (- x 1) )
    Functions

    Code:
    (define  foo (n) (+ n 1))
    (foo 5)
    Recursion?
    Code:
    (define  sum (n) (if (= n 0) (0) (+ n (sum (- n 1)))))
    Congratulations, you have your own Turing complete programming language!

    (Also, you are one simple trick away from LISP.)
    Last edited by manasij7479; 11-03-2017 at 01:04 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 01-29-2014, 02:40 PM
  2. Most challenging field
    By herWter in forum Tech Board
    Replies: 3
    Last Post: 07-24-2008, 03:13 PM
  3. Challenging Problem
    By gamx in forum C Programming
    Replies: 1
    Last Post: 05-26-2008, 10:59 AM
  4. Challenging question.
    By hhhmortal in forum C Programming
    Replies: 2
    Last Post: 12-06-2007, 03:47 PM
  5. MFC is Challenging :: C++
    By kuphryn in forum C++ Programming
    Replies: 8
    Last Post: 02-05-2002, 01:33 AM

Tags for this Thread