Ah, but you're not.  Hence the challenge!

(The idea was to let the table speak for itself - essentially, build an 
interpreter for it, introducing as little complexity as you can manage.  Yes, 
this is a fuzzy goal.)

-Dan




Please excuse typos; composed on a handheld device.

-----Original Message-----
From: Raul Miller <[email protected]>
Sender: [email protected]
Date: Mon, 27 Sep 2010 17:03:14 
To: Programming forum<[email protected]>
Reply-To: Programming forum <[email protected]>
Subject: Re: [Jprogramming] Computus

Here is how I would deal with the first challenge:

easter=:3 :0
  'O a'=.|:0  19#: y
  'b c'=.|:0 100#: y
  'd e'=.|:0   4#: b
  'g O'=.|:0  25#: 13+8*b
  'O h'=.|:0  30#: 15+b+(19*a)-d+g
  'u O'=.|:0 319#: a+11*h
  'i k'=.|:0   4#: c
  'O q'=.|:0   7#: 32+u+(2*e+i)-k+h
  'n O'=.|:0  25#: 90+q+h-u
  'O p'=.|:0  32#: 19+n+q+h-u
  |:>y;n;p
)

If I am allowed to recast the table definitions into the textual
format I used here, eval seems simple.

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to