I have a short section of old basic code I'd like to get working in swift to see what the printed output looks like. See swift code I have started and original basic code below.
func getStringFromCode(_ code: Int) -> Character {
return Character( UnicodeScalar(code)!)
}
let data = [-93,0,-6,255,-19,0,255,255,-90,0,255,255,-19,0,-6,255,-101,0,1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128,-60,0,1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128,-20,0]
var next = 0
print("\(getStringFromCode(27))A\(getStringFromCode(8))")
for N0 in 1..<7 {
print("\(getStringFromCode(27))K\(getStringFromCode(194))")
for G0 in 1..<450 {
var X0 = data[next]
next = next + 1
if X0 >= 0 {
print("\(getStringFromCode(X0))")
} else {
G0 = G0 - X0 - 1
R0 = data[next]
next = next + 1
}
print("\(getStringFromCode(Y0))")
}
}
/*
61855 LPRINT CHR$(27)"A"CHR$(8);
61920 FOR N0 = 1 TO 6
61925 LPRINT CHR$(27)"K"CHR$(194)CHR$(1);
61930 FOR G0 = 1 TO 450
61940 READ X0
62010 IF X0 >=0 THEN LPRINT CHR$(X0);:GOTO 62100
62050 G0 = G0 - X0 - 1
62060 READ Y0
62070 FOR I0 = 1 TO ABS(X0)
62080 LPRINT CHR$(Y0);
62090 NEXT I0
62100 NEXT G0
62110 LPRINT
62150 NEXT N0
62165 REM
62170 REM
62465 DATA -93,0,-6,255,-19,0,255,255,-90,0,255,255,-19,0,-6,255,-101,0,1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128,-60,0,1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128,-20,0
62470 DATA -93,0,-6,255,-19,0,255,255,-90,0,255,255,-19,0,-6,255,-93,0,1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128,-60,0,1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128,-28,0
62475 DATA -93,0,-6,255,-19,0,255,255,-90,0,255,255,-19,0,-6,255,-85,0,1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128,-60,0,1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128,-36,0
62480 DATA -93,0,-6,255,7,-18,0,255,255,-90,8,255,255,-18,0,7,-6,255,-80,0,1,3,7,15,255,-7,0,255,15,7,3,1,-59,0,1,3,7,15,255,-7,0,255,15,7,3,1,-40,0
62485 DATA -93,0,-8,255,31,7,1,-14,0,255,255,-90,128,255,255,-14,0,1,7,31,-8,255,-79,0,-6,255,-7,0,-6,255,-57,0,-6,255,-7,0,-6,255,-39,0
62490 DATA -92,0,1,-11,255,127,31,15,7,3,1,1,-7,0,255,255,-90,0,255,255,-7,0,1,1,3,7,15,31,127,-11,255,1,-77,0,1,-6,255,-7,1,-6,255,1,-55,0,1,-6,255,-7,1,-6,255,1,-38,0
*/