[plt-scheme] input from file

From: Don (dfelgar at rainier-infosys.com)
Date: Sat Apr 3 20:32:58 EST 2004

On Sat, Apr 03, 2004, Markus Spath wrote:

> hi,
> 
> I need some help reading data from a file.

> (define (questions-hardcoded)
>   (list
>    (make-question 'q1 10 20)
>    (make-question 'q2 5 13)
>    (make-question 'q3 5 8)
>    ...))
> 
> (define questions (questions-hardcoded))

> data.txt:
> --
> q1 10 20
> q2 5 13
> q3 5 8

FWIW, PLT includes a quiz applet sample that reads questions from a
data file and presents them to the user:

/plt/collects/web-server/default-web-root/servlets/examples/quiz.ss
/plt/collects/web-server/default-web-root/servlets/examples/english-measure-questions.ss

Good luck.
--Don


Posted on the users mailing list.