*** RESULT COMPETITION 2008 ***

Started by newdep, November 24, 2008, 09:07:02 AM

Previous topic - Next topic

newdep

******************************************************************







http://portovert.com/files/Article/thumbnail2.jpg">http://portovert.com/files/Article/thumbnail2.jpg[/img]























(option #2) A newlisp enhanced parenthesis checker


A program/script that returns the exact position of the missing/extra paranthesis inside the checked newlisp-script.
(The buildin newlisp intepreter isn't accurate enough, from my point of view, to point out "where" it went wrong..)

The paranthesis check should at least contain]..[/text]
Not check data in comments. ; or #

How you target your paranthesis checker is up to you,
main issue is that it returns accurate information regarding
the paranthesis mismatch (missing/extra) inside the checked newlisp-script.




(option #3) A newlisp AI[/color]
[code]
A program/script that demonstrates newlisp and Artificial Intelligence.
Where the script must show its capebility to "learn" from data.
It must use FOOP.
User interaction and manual data-input-feeding is not allowed. (like a chat program)
Ofcourse you can provide data for learning purposes.
http]




(option #4) A newlisp calendar [/color]
[code]
A program/script should be able to return the name of the day of the given, any!, date as input.
(where monday is the first day of the week).

The calendar should at least return]






Enjoy...





PS: questions/answers/suggestions/donations (koffie/beer/milk/cooky's) are welcome.





PPS:

-Competition ends 31st of December 2008 at (23:59:59)

-Please post your code/link befor the 31th of December in this Forum topic
-- (define? (Cornflakes))

newdep

#1
I had a question/answer minute with Lutz about the Contest content.

I added 3 more options just to make it more variable for the users.

A 'profiler' is very nice but im not sure if that would trigger enough

people to join in.. The other options should be able to tickle more people..



Hope you all agree...



Enjoy..
-- (define? (Cornflakes))

cormullion

#2
Excellent! I shall attempt to write one script that does all four at once...! :)



Post only on the 31st December? Mustn't plan to party that night...

Cyril

#3
Quote from: "newdep" (option #4) A newlisp calendar [/color]


Just to make the first entry]
;; @module zeller.lsp
;; @description Straightforward implementation of Zeller's congruence
;; @author Cyril Slobin
;; @location http://slobin.pp.ru/newlisp/zeller.lsp
;; @version 2.0, corrected and updated
;;
;; See also @link http://en.wikipedia.org/wiki/Zeller%27s_congruence
;; Zeller's_congruence article in Wikipedia
;;
;; Date format on input as specified by newdep, exactly

; The week starts with Saturday, it's a feature of the algorithm used
(setq week '(Saturday Sunday Monday Tuesday Wednesday Thursday Friday))

; Modulo is not the same as reminder
(define (%% x y) (% (+ (% x y) y) y))

; Division with modulo-aware rounding
(define (// x y) (/ (- x (%% x y)) y))

; Zeller's congruence, verbatim
(define (zeller q m year , h J K)
  (when (member m '(1 2))
    (inc m 12)
    (dec year))
  (setq J (// year 100))
  (setq K (%% year 100))
  (setq h (+ q (// (* 26 (+ m 1)) 10) K (// K 4) (// J 4) (* -2 J)))
  (week (%% h 7)))

; Note that newdep specified dd/mm/yyyy for AC, but mm/dd/-yyyy for BC
(while (read-line)
  (map set '(aa bb year) (map int (parse (current-line) "/")))
  (case (sgn year)
    (0 (println "No zeroth year!"))
    (+1 (println (zeller aa bb year)))
    (-1 (println (zeller bb aa (+ year 1))))))

(exit)

[/code]
Sorry, this is kinda practical joke, but it works nevertheless. ;-)



Oops! Updated to version 2.0, previous gives wrong answers B.C.
With newLISP you can grow your lists from the right side!

newdep

#4
Your sorry is not accepted ;-) Nice coding and reading between the lines ;-)
-- (define? (Cornflakes))

Cyril

#5
Quote from: "newdep"Your sorry is not accepted ;-) Nice coding and reading between the lines ;-)


Sorry nevertheless -- the first version was WRONG. The moral of that is, NEVER try to "optimize" formulae given to you by the astronomer! I am an amateur astronomer myself, I say this from experience! The post above was corrected for version 2.0, with hope it is right this time.
With newLISP you can grow your lists from the right side!

Kazimir Majorinc

#6
I might enter in AI class if it is allowed to bend rules somehow, i.e. that major part of the program is written in old fashioned procedural imperative style, but I can still use FOOP for some minor issue.



Is it acceptable compromise?
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

newdep

#7
If you clearly outline what is different from the rules inside your code,

(i.e. in your case: not using FOOP)

I think people won't mind you coding it ;-)



FOOP seems to be a nice base for this but if your code can

do without...no problem with me....
-- (define? (Cornflakes))

cormullion

#8
My entry is posted/described here:



http://www.alh.net/newlisp/phpbb/viewtopic.php?p=14436">//http://www.alh.net/newlisp/phpbb/viewtopic.php?p=14436



It's a simple newLISP script profiler, called mycroft.

newdep

#9
[size=200]--- 1 DAY TO GO ---[/size]
-- (define? (Cornflakes))

m i c h a e l

#10
One day left?! There is no way I can deform any of my scripts to fit within the contest rules that quickly, but it was making me sad seeing cormullion standing there proudly holding his contest entry all alone :-( But since http://www.alh.net/newlisp/phpbb/viewtopic.php?p=14436">mycroft is so cool, anyway, he probably has it in the bag this year ;-)



Happy 2009 to the entire newLISP community! I'm anxious to see what fantastic things are in store for our favorite language.



m i c h a e l

Kazimir Majorinc

#11
I didn't completed application I intended to write, so I'll also give up this year.
http://kazimirmajorinc.com/\">WWW site; http://kazimirmajorinc.blogspot.com\">blog.

newdep

#12
[size=200]



*** HAPPY 2009 ***



May The Lisp be with you! ;-)



[/size]
-- (define? (Cornflakes))

cormullion

#13
nothing from you norman? Ah well, you have a good excuse! :(



Perhaps announce the 2009 contest soon - give everyone more time! :)

m i c h a e l

#14
In my above post, I unintentionally ignored Cyril, who, having arrived early, was quietly sitting on the stage waiting for the winner to be announced.



Cyril, please forgive my having forgotten your worthy entry.


Quote from: "Norman"Im not sure if setting pre-tasks as a good way to setup competitions but it was worth trying it and 2 nice contributions came in..!


Maybe the pre-tasks would have worked better with a larger group of active members, but with such a small group here, I'm afraid it may have hindered participation. Cyril's and cormullion's entries are proof it was worth a try, though.



m i c h a e l