- (scores->rankings (load-scores dir)))
-
-(define (hill-add-file file name dir)
- (copy-file file (make-pathname dir (->string name) ".red")))
+ (with-input-from-file (make-pathname dir "rankings") read))
+
+(define (hill-news dir)
+ (with-input-from-file (make-pathname dir "news") read))
+
+(define (hill-news-add dir . args)
+ (let* ((old-news (hill-news dir))
+ (news-string (apply conc args))
+ (new-news (cons (cons (seconds->string) news-string) old-news)))
+ (print news-string)
+ (with-output-to-file (make-pathname dir "news")
+ (lambda () (pretty-print new-news)))))
+
+(define (hill-add dir file)
+ (let* ((prog (file->prog file))
+ (name (prog-name prog))
+ (author (prog-author prog))
+ (submitted (seconds->string)))
+ (copy-file file (make-pathname dir name ".red"))
+ (with-output-to-file (make-pathname dir name ".info")
+ (lambda ()
+ (pretty-print (list author submitted))))))
+
+(define (hill-remove dir name)
+ (delete-file (make-pathname dir name ".red"))
+ (delete-file (make-pathname dir name ".info")))