Well,
I am excited that there is a new release! I will have to be sure to
let my students know about it! I will download it as soon as I get
this piece of code posted.
Here is a program one of my students put together this term.
(* Written by T. Nathan Wheeler *)
(* Date: 2453110.5 (04/15/2004) *)
~ tojulian { (* yyyy m d --- days *)
(* This function uses the formula given on page 405 of *)
(* JAVA Algorithms by Scott Robert Ladd to convert a *)
(* Gregorian date in the form yyyy mm dd to a Julian *)
(* date (i.e. the number of days since Jan 1, 4713 BC) *)
(* I am not sure why a Klingon would have need of this but *)
(* it made a fun demonstration for a class project. ;) *)
"day" cher (* store the day *)
latlh 2 law''a' wIv (* is month > Feb? *)
{ woD "month" cher 1 } HIja'chugh (* just store the month *)
{ 12 boq "month" cher } ghobe'chugh (* add 12 and store the
month *)
latlh 2 law''a' wIv (* is month > Feb? *)
{ woD "year" cher 1 } HIja'chugh (* just store the year *)
{ 1 boqHa' "year" cher } ghobe'chugh (* subtract 1 and store
year *)
year 100 boqHa''egh poD 2 tam boqHa' (* 2 - INT(year/100) *)
year 400 boqHa''egh poD boq (* + INT(year/400) *)
365.25 year boq'egh poD boq (* [INT(365.25*year)] + *)
30.6001 month 1 boq boq'egh poD boq (* [INT(30.6001*
(month+1))] + *)
day boq (* [day] + *)
1720994.5 boq (* add the base constant
(1720994.5) *)
} pong
(* testing area *)
2004 04 06 tojulian cha' (* should return 2453101.5 *)
2004 04 15 tojulian cha' (* should return 2453110.5 *)
Note that comments in the Var'aq interpreter are confined to a
single line, so if the code wraps in this post, you might have to
reformat it slightly to get it to work.
Have fun!
_Merrick