A vision from The Sussman came to me, and he told me what I was doing was Good but that I could do Better. May he enjoy this RevisedThe SecondThe ABC Programming LanguageAlgorithmic Implementation: (define (abc source)
(define accumulator 0)
(define ascii #f)
(define (interpret i)
(case i
((#\a) (set! accumulator (+ 1 accumulator)))
((#\b) (set! accumulator (- accumulator 1)))
((#\c) (display (if ascii
(integer->char accumulator)
accumulator)))
((#\d) (set! accumulator (- accumulator)))
((#\r) (set! accumulator (random accumulator)))
((#\n) (set! accumulator 0))
((#\$) (set! ascii (not ascii)))
((#\l) (run))
((#\;) (display accumulator)
(display (integer->char accumulator)))))
(define (run)
(for-each interpret (map char-downcase (string->list source)))
(newline))
(run))
Name:
Anonymous2008-08-01 21:58
I love you
Name:
Anonymous2008-08-01 21:59
>>86 A vision from The Sussman came to me, and he told me what I was doing was Good but that I could do Better.
No, that was Star Wolf.
You may laugh, but work is undergoing1 on a C to Befunge compiler.
_________________ 1In the very loosest sense of the word `undergoing'2 2J^4: C-to-Befunge compiler. Lee, J. http://www.phlamethrower.co.uk/befunge/c2b.php. Modified March 23, 2008; Retrieved August 3, 2008.
Name:
Anonymous2008-08-03 18:54
This thread is about the ABC programming language, for newcomers to the discussion :)