All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
print 'print 'print 'print ... (Posted on 2003-09-19) Difficulty: 5 of 5
Write a program that prints itself.

See The Solution Submitted by DJ    
Rating: 4.6875 (16 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Self Printing Program in BASIC | Comment 16 of 32 |
105 A$=CHR$(32)+CHR$(68)+CHR$(65)+CHR$(84)+CHR$(65)+CHR$(32)+CHR$(34)
110 B$=CHR$(32)
115 C$=CHR$(34)
120 FOR I=100 TO 200 STEP 100
125 FOR J=5 TO 75 STEP 5
130 READ D$
135 L$=MID$(STR$(I+J),2)
140 IF I=100 THEN 155
145 PRINT L$+A$+D$+C$
150 GOTO 160
155 PRINT L$+B$+D$
160 NEXT J
165 RESTORE
170 NEXT I
175 END
205 DATA "A$=CHR$(32)+CHR$(68)+CHR$(65)+CHR$(84)+CHR$(65)+CHR$(32)+CHR$(34)"
210 DATA "B$=CHR$(32)"
215 DATA "C$=CHR$(34)"
220 DATA "FOR I=100 TO 200 STEP 100"
225 DATA "FOR J=5 TO 75 STEP 5"
230 DATA "READ D$"
235 DATA "L$=MID$(STR$(I+J),2)"
240 DATA "IF I=100 THEN 155"
245 DATA "PRINT L$+A$+D$+C$"
250 DATA "GOTO 160"
255 DATA "PRINT L$+B$+D$"
260 DATA "NEXT J"
265 DATA "RESTORE"
270 DATA "NEXT I"
275 DATA "END"
  Posted by Brian Smith on 2003-09-23 13:36:54
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (2)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information