MultiFor(;;;)

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

int green = 0;
int y1, x1;
for (y1 = 0 , x1 = 0; y1 < bm.bmHeight; ((x1 < bm.bmWidth) ? x1++ : (green++, x1 = 0, y1++)))
{
SetPixel(hdc, x1, y1, RGB(0, green, 0));
}

:D

TRON: GAME LOADER!

I invented a doom like game after Elite Came out.
Was 3d maze lines, forward, back, left, right into each coridoor section & shoot.
Did not have turn going though.
Was on a BBC Micro, Model B, 32k RAM & Disk Drive! Back in 1984-86.
Based on data grid like

000000000000000
0.................. 0
0...000000000000
0.................. 0
000000000000000

Back then it was line numbers, 10, 20, 30...
if you added a line 15 it was command renumber 10, 10.
Had command goto 20. If you were clever enough you learned functions called procedures.

We had computer magazines in newsagents including pages of code you could type out for a game.
Problem though, the magazine printing was so poor you could not tell a , from a . Or a l from a 1. No fun :(

Post

yes

Post

Code: Select all

asin(yes) / asin(1.0)
It doesn't matter how it sounds..
..as long as it has BASS and it's LOUD!

irc.libera.chat >>> #kvr

Post

1 CLS:GOSUB 12
3 GOSUB 1070
4 CLS
5 GOSUB 3000:PRINT:IF PR$="Y" THEN GOTO 7
6 U$ = INKEY$:IF U$ = "" THEN 6
7 CLS
8 GOSUB 1400 :IF PR$ = "Y" THEN GOTO 10
9 U$ = INKEY$:IF U$ = "" THEN 9
10 GOSUB 5000:END
12 DATA 358.4758,35999.0498,-.0002,.01675,-.4E-4,0,1,101.2208,1.7192,.00045,0,0
16 DATA 0,0,0,0,102.2794,149472.515,0,.205614,.2E-4,0,.3871,28.7538,.3703,.0001
20 DATA 47.1459,1.1852,.0002,7.009,.00186,0,212.6032,58517.8039,.0013,.00682
22 DATA -.5E-4,0,.7233,54.3842,.5082,-.14E-2,75.7796,.8999,.4E-3
26 DATA 3.3936,.1E-2,0,319.5294,19139.8585,.2E-3,.09331,.9E-4,0,1.5237,285.4318
30 DATA 1.0698,.1E-3,48.7864,.77099,0,1.8503,-.7E-3,0,225.4928,3033.6879,0
32 DATA .04838,-.2E-4,0,5.2029,273.393,1.3383,0,99.4198,1.0583,0,1.3097
36 DATA -.52E-2,0,-.001,-.0005,.0045,.0051,581.7,-9.7,-.0005,2510.7,-12.5
38 DATA -.0026,1313.7,-61.4,.0013,2370.79,-24.6,-.0013,3599.3,37.7,-.001,2574.7
40 DATA 31.4,-.00096,6708.2,-114.5,-.0006,5499.4,-74.97,-.0013,1419,54.2,.0006
42 DATA 6339.3,-109,.0007,4824.5,-50.9,.0020,-.0134,.0127,-.0023,676.2,.9,.00045
44 DATA 2361.4,174.9,.0015,1427.5,-188.8,.0006,2110.1,153.6,.0014,3606.8,-57.7
46 DATA -.0017,2540.2,121.7,-.00099,6704.8,-22.3,-.0006,5480.2,24.5,.00096
50 DATA 1651.3,-118.3,.0006,6310.8,-4.8,.0007,4826.6,36.2,174.2153,1223.50796
52 DATA 0,.05423,-.2E-3,0,9.5525,338.9117,-.3167,0,112.8261,.8259,0,2.4908
56 DATA -.0047,0,-.0009,.0037,0,.0134,1238.9,-16.4,-.00426,3040.9,-25.2,.0064
58 DATA 1835.3,36.1,-.0153,610.8,-44.2,-.0015,2480.5,-69.4,-.0014,.0026,0,.0111
60 DATA 1242.2,78.3,-.0045,3034.96,62.8,-.0066,1829.2,-51.5,-.0078,640.6,24.2
62 DATA -.0016,2363.4,-141.4,.0006,-.0002,0,-.0005,1251.1,43.7,.0005,622.8
66 DATA 13.7,.0003,1824.7,-71.1,.0001,2997.1,78.2,74.1757,427.2742,0,.04682
70 DATA .00042,0,19.2215,95.6863,2.0508,0,73.5222,.5242,0,.7726,.1E-3,0,-.0021
72 DATA -.0159,0,.0299,422.3,-17.7,-.0049,3035.1,-31.3,-.0038,945.3,60.1
74 DATA -.0023,1227,-4.99,.0134,-.02186,0,.0317,404.3,81.9,-.00495,3037.9,57.3
76 DATA .004,993.5,-54.4,-.0018,1249.4,79.2,-.0003,.0005,0,.0005,352.5,-54.99
80 DATA .0001,3027.5,54.2,-.0001,1150.3,-88,30.13294,240.45516,0,.00913,-.00127
84 DATA 0,30.11375,284.1683,-21.6329,0,130.68415,1.1005,0,1.7794,-.0098,0,.1832
86 DATA -.6718,.2726,-.1923,175.7,31.8,.0122,542.1,189.6,.0027,1219.4,178.1
88 DATA -.00496,3035.6,-31.3,-.1122,.166,-.0544,-.00496,3035.3,58.7,.0961,177.1
90 DATA -68.8,-.0073,630.9,51,-.0025,1236.6,78,.00196,-.0119,.0111,.0001
94 DATA 3049.3,44.2,-.0002,893.9,48.5,.00007,1416.5,-25.2,229.781,145.1781,0
96 DATA .24797,.002898,0,39.539,113.5366,.2086,0,108.944,1.3739,0,17.1514

Post

gosub. Loved it.

Post

gafferuk wrote:int green = 0;
int y1, x1;
for (y1 = 0 , x1 = 0; y1 < bm.bmHeight; ((x1 < bm.bmWidth) ? x1++ : (green++, x1 = 0, y1++)))
{
SetPixel(hdc, x1, y1, RGB(0, green, 0));
}
:D
If you're proud of that, please note that green is always the same as y1 in your code, so one of the two can be optimized away. Also, please note that calling SetPixel() for each dot of a horizontal line is as inefficient as it gets.
"Until you spread your wings, you'll have no idea how far you can walk." Image

Post Reply

Return to “DSP and Plugin Development”