RosettaCodeData/Task/Word-wrap/IS-BASIC/word-wrap.basic

19 lines
1003 B
Plaintext

100 TEXT 80
110 CALL WRITE(12,68,0)
120 PRINT :CALL WRITE(10,70,1)
130 DEF WRITE(LEFTMARGIN,RIGHTMARGIN,JUSTIFIED)
140 STRING S$*254
150 RESTORE
160 PRINT TAB(LEFTMARGIN);CHR$(243);
170 PRINT TAB(RIGHTMARGIN-1);CHR$(251)
180 DO
190 READ IF MISSING EXIT DO:S$
200 PRINT S$;
210 LOOP
220 IF JUSTIFIED THEN PRINT CHR$(248) ! <- Extra credit :-)
230 PRINT
240 END DEF
250 DATA "In olden times when wishing still helped one, there lived a king whose daughters were all beautiful, but the youngest was so beautiful that the sun itself, which has seen so much, was astonished whenever it shone in her face. "
260 DATA "Close by the king's castle lay a great dark forest, and under an old lime-tree in the forest was a well, and when the day was very warm, the king's child went out into the forest and sat down by the side of the cool fountain, "
270 DATA "and when she was bored she took a golden ball, and threw it up on high and caught it, and this ball was her favorite plaything."