Skip to main content
deleted 47 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104

Applesoft BASIC, 930 783 782 727 719 702 695695 637 bytes

-72 bytes and a working program thanks to ceilingcat spotting my error and a shortened algorithm

0TEXT:HOME:INPUTS1INPUTN:HGR:HCOLOR=3:W=279:H=159:W0=WL=W-100:W1=W0Z=L/10:H1=HB=H-100:H2=HC=H-60:K=0.5:M=1/(2*3.14159265*S1*S114159265*N*N):FORI=0TO10STEPK:X=10*I+1:Y=10*I+H1Y=10*I+B:HPLOTX,Y:FORJ=0TOW0FORJ=0TOL STEP1:J1=10*JO=10*J/W0L:D1=ABSD=ABS(5-I):D2=ABSE=ABS(5-J1O):R2=R=(D1*D1+D2*D2D*D+E*E)/(2*S1*S12*N*N):G=EXP(-R2R)*M:A=INT((H2*GC*G)/M):X=10*I+W1*J1+1X=10*I+Z*O+1:Y=10*I+H1Y=10*I+B-A:HPLOTTOX,Y:IF(I=0)GOTO4
1IF(J=W0J=L)GOTO3
2J2=INT2V=INT(J/10):IF((J/10)<>J2<>V)GOTO5
3D1=ABS3D=ABS(5-I+K):D2=ABSE=ABS(5-J1O):R2=R=(D1*D1+D2*D2D*D+E*E)/(2*S1*S12*N*N):U=EXP(-R2R)/(2*3.14159*S1*S114159*N*N):A1=INTS=INT((H2*UC*U)/M):X1=10*P=10*(I-K)+W1*J1+1+Z*O+1:Y1=10*Q=10*(I-K)+H1+B-A1S:HPLOT TOX1TOP,Y1Q:HPLOTX,Y
4IF(J=0)GOTO7:IF(I<10)GOTO5:IF(J=W0J=L)GOTO6:J2=INTV=INT(J/10):IF((J/10)=J2=V)GOTO6
5HCOLOR=0
6HPLOTTOX,10*I+H110*I+B:HCOLOR=3:HPLOTX,Y
7NEXTJ:NEXTI:HPLOTW+1,H:HPLOTTO101,H:HPLOTTO0+1,H1H

Ungolfed version here.

When given input 1:

input-1

When given input 2:

input-2

Applesoft BASIC, 930 783 782 727 719 702 695 bytes

-72 bytes and a working program thanks to ceilingcat spotting my error and a shortened algorithm

0TEXT:HOME:INPUTS1:HGR:HCOLOR=3:W=279:H=159:W0=W-100:W1=W0/10:H1=H-100:H2=H-60:K=0.5:M=1/(2*3.14159265*S1*S1):FORI=0TO10STEPK:X=10*I+1:Y=10*I+H1:HPLOTX,Y:FORJ=0TOW0 STEP1:J1=10*J/W0:D1=ABS(5-I):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):G=EXP(-R2)*M:A=INT((H2*G)/M):X=10*I+W1*J1+1:Y=10*I+H1-A:HPLOTTOX,Y:IF(I=0)GOTO4
1IF(J=W0)GOTO3
2J2=INT(J/10):IF((J/10)<>J2)GOTO5
3D1=ABS(5-I+K):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):U=EXP(-R2)/(2*3.14159*S1*S1):A1=INT((H2*U)/M):X1=10*(I-K)+W1*J1+1:Y1=10*(I-K)+H1-A1:HPLOT TOX1,Y1:HPLOTX,Y
4IF(J=0)GOTO7:IF(I<10)GOTO5:IF(J=W0)GOTO6:J2=INT(J/10):IF((J/10)=J2)GOTO6
5HCOLOR=0
6HPLOTTOX,10*I+H1:HCOLOR=3:HPLOTX,Y
7NEXTJ:NEXTI:HPLOTW+1,H:HPLOTTO101,H:HPLOTTO0+1,H1

Ungolfed version here.

When given input 1:

input-1

When given input 2:

input-2

Applesoft BASIC, 930 783 782 727 719 702 695 637 bytes

-72 bytes and a working program thanks to ceilingcat spotting my error and a shortened algorithm

0TEXT:HOME:INPUTN:HGR:HCOLOR=3:W=279:H=159:L=W-100:Z=L/10:B=H-100:C=H-60:K=0.5:M=1/(2*3.14159265*N*N):FORI=0TO10STEPK:X=10*I+1:Y=10*I+B:HPLOTX,Y:FORJ=0TOL STEP1:O=10*J/L:D=ABS(5-I):E=ABS(5-O):R=(D*D+E*E)/(2*N*N):G=EXP(-R)*M:A=INT((C*G)/M):X=10*I+Z*O+1:Y=10*I+B-A:HPLOTTOX,Y:IF(I=0)GOTO4
1IF(J=L)GOTO3
2V=INT(J/10):IF((J/10)<>V)GOTO5
3D=ABS(5-I+K):E=ABS(5-O):R=(D*D+E*E)/(2*N*N):U=EXP(-R)/(2*3.14159*N*N):S=INT((C*U)/M):P=10*(I-K)+Z*O+1:Q=10*(I-K)+B-S:HPLOT TOP,Q:HPLOTX,Y
4IF(J=0)GOTO7:IF(I<10)GOTO5:IF(J=L)GOTO6:V=INT(J/10):IF((J/10)=V)GOTO6
5HCOLOR=0
6HPLOTTOX,10*I+B:HCOLOR=3:HPLOTX,Y
7NEXTJ:NEXTI:HPLOTW+1,H:HPLOTTO101,H:HPLOTTO0+1,H

Ungolfed version here.

When given input 1:

input-1

When given input 2:

input-2

golfed and fixed *something*
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104

Applesoft BASIC, 930 783 782 727 719 702702 695 bytes

-72 bytes and a working program thanks to ceilingcat spotting my error and a shortened algorithm

0TEXT:HOME:INPUTS1:HGR:HCOLOR=3:W=279:H=159:W0=W-100:W1=W0/10:H1=H-100:H2=H-60:K=0.5:M=1/(2*3.14159265*S1*S1):FORI=0 TO10 STEPKFORI=0TO10STEPK:X=10*I+1:Y=10*I+H1:HPLOTX,Y:FORJ=0 TOW0FORJ=0TOW0 STEP1:J1=10*J/W0:D1=ABS(5-I):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):G=EXP(-R2)*M:A=INT((H2*G)/M):X=10*I+W1*J1+1:Y=10*I+H1-A:HPLOT TOXHPLOTTOX,Y:IF(I=0)GOTO4
1IF(J=W0)GOTO3
2J2=INT(J/10):IF((J/10)<>J2)GOTO5
3D1=ABS(5-I+K):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):U=EXP(-R2)/(2*3.14159*S1*S1):A1=INT((H2*U)/M):X1=10*(I-K)+W1*J1+1:Y1=10*(I-K)+H1-A1:HPLOT TOX1,Y1:HPLOTX,Y
4F4IF(J=0)GOTO 7GOTO7:IF(I<10)GOTO5:IF(J=W0)GOTO6:J2=INT(J/10):IF((J/10)=J2)GOTO6
5HCOLOR=0
6HPLOT TOX6HPLOTTOX,10*I+H1:HCOLOR=3:HPLOTX,Y
7NEXTJ:NEXTI:HPLOTW+1,H:HPLOT TO101HPLOTTO101,H:HPLOT TO0+1HPLOTTO0+1,H1

Ungolfed version here.

When given input 1:

input-1

When given input 2:

input-2

Applesoft BASIC, 930 783 782 727 719 702 bytes

-72 bytes and a working program thanks to ceilingcat spotting my error and a shortened algorithm

0TEXT:HOME:INPUTS1:HGR:HCOLOR=3:W=279:H=159:W0=W-100:W1=W0/10:H1=H-100:H2=H-60:K=0.5:M=1/(2*3.14159265*S1*S1):FORI=0 TO10 STEPK:X=10*I+1:Y=10*I+H1:HPLOTX,Y:FORJ=0 TOW0 STEP1:J1=10*J/W0:D1=ABS(5-I):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):G=EXP(-R2)*M:A=INT((H2*G)/M):X=10*I+W1*J1+1:Y=10*I+H1-A:HPLOT TOX,Y:IF(I=0)GOTO4
1IF(J=W0)GOTO3
2J2=INT(J/10):IF((J/10)<>J2)GOTO5
3D1=ABS(5-I+K):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):U=EXP(-R2)/(2*3.14159*S1*S1):A1=INT((H2*U)/M):X1=10*(I-K)+W1*J1+1:Y1=10*(I-K)+H1-A1:HPLOT TOX1,Y1:HPLOTX,Y
4F(J=0)GOTO 7:IF(I<10)GOTO5:IF(J=W0)GOTO6:J2=INT(J/10):IF((J/10)=J2)GOTO6
5HCOLOR=0
6HPLOT TOX,10*I+H1:HCOLOR=3:HPLOTX,Y
7NEXTJ:NEXTI:HPLOTW+1,H:HPLOT TO101,H:HPLOT TO0+1,H1

Ungolfed version here.

When given input 1:

input-1

When given input 2:

input-2

Applesoft BASIC, 930 783 782 727 719 702 695 bytes

-72 bytes and a working program thanks to ceilingcat spotting my error and a shortened algorithm

0TEXT:HOME:INPUTS1:HGR:HCOLOR=3:W=279:H=159:W0=W-100:W1=W0/10:H1=H-100:H2=H-60:K=0.5:M=1/(2*3.14159265*S1*S1):FORI=0TO10STEPK:X=10*I+1:Y=10*I+H1:HPLOTX,Y:FORJ=0TOW0 STEP1:J1=10*J/W0:D1=ABS(5-I):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):G=EXP(-R2)*M:A=INT((H2*G)/M):X=10*I+W1*J1+1:Y=10*I+H1-A:HPLOTTOX,Y:IF(I=0)GOTO4
1IF(J=W0)GOTO3
2J2=INT(J/10):IF((J/10)<>J2)GOTO5
3D1=ABS(5-I+K):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):U=EXP(-R2)/(2*3.14159*S1*S1):A1=INT((H2*U)/M):X1=10*(I-K)+W1*J1+1:Y1=10*(I-K)+H1-A1:HPLOT TOX1,Y1:HPLOTX,Y
4IF(J=0)GOTO7:IF(I<10)GOTO5:IF(J=W0)GOTO6:J2=INT(J/10):IF((J/10)=J2)GOTO6
5HCOLOR=0
6HPLOTTOX,10*I+H1:HCOLOR=3:HPLOTX,Y
7NEXTJ:NEXTI:HPLOTW+1,H:HPLOTTO101,H:HPLOTTO0+1,H1

Ungolfed version here.

When given input 1:

input-1

When given input 2:

input-2

added 2 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104

Applesoft BASIC, 930 783 782 727727 719 702 bytes

-5572 bytes and a working program thanks to ceilingcat spotting my error and a shortened algorithm

0 TEXT0TEXT:HOME:INPUTS1:HGR:HCOLOR=3:W=279:H=159:W0=W-100:W1=W0/10:H1=H-100:H2=H-60:K=0.5:M=1/(2*3.14159265*S1*S1):FORI=0 TO10 STEPK:X=10*I+1:Y=10*I+H1:HPLOTX,Y:FORJ=0 TOW0 STEP1:J1=10*J/W0:D1=ABS(5-I):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):G=EXP(-R2)/(2*3.14159*S1*S1)*M:A=INT((H2*G)/M):X=10*I+W1*J1+1:Y=10*I+H1-A:HPLOT TOX,Y:IF(I=0)GOTO4
1 IF1IF(J=W0)GOTO3
2 J2=INT2J2=INT(J/10):IF((J/10)<>J2)GOTO5
3 D1=ABS3D1=ABS(5-I+K):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):U=EXP(-R2)/(2*3.14159*S1*S1):A1=INT((H2*U)/M):X1=10*(I-K)+W1*J1+1:Y1=10*(I-K)+H1-A1:HPLOT TOX1,Y1:HPLOTX,Y
4 IF4F(J=0)GOTO 7:IF(I<10)GOTO5:IF(J=W0)GOTO6:J2=INT(J/10):IF((J/10)=J2)GOTO6
5 HCOLOR=05HCOLOR=0
6 HPLOT6HPLOT TOX,10*I+H1:HCOLOR=3:HPLOTX,Y
7 NEXTJ7NEXTJ:NEXTI:HPLOTW+1,H:HPLOT TO101,H:HPLOT TO0+1,H1

Ungolfed version here.

When given input 1:

input-1

When given input 2:

input-2

Applesoft BASIC, 930 783 782 727 bytes

-55 bytes and a working program thanks to ceilingcat spotting my error

0 TEXT:HOME:INPUTS1:HGR:HCOLOR=3:W=279:H=159:W0=W-100:W1=W0/10:H1=H-100:H2=H-60:K=0.5:M=1/(2*3.14159265*S1*S1):FORI=0 TO10 STEPK:X=10*I+1:Y=10*I+H1:HPLOTX,Y:FORJ=0 TOW0 STEP1:J1=10*J/W0:D1=ABS(5-I):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):G=EXP(-R2)/(2*3.14159*S1*S1):A=INT((H2*G)/M):X=10*I+W1*J1+1:Y=10*I+H1-A:HPLOT TOX,Y:IF(I=0)GOTO4
1 IF(J=W0)GOTO3
2 J2=INT(J/10):IF((J/10)<>J2)GOTO5
3 D1=ABS(5-I+K):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):U=EXP(-R2)/(2*3.14159*S1*S1):A1=INT((H2*U)/M):X1=10*(I-K)+W1*J1+1:Y1=10*(I-K)+H1-A1:HPLOT TOX1,Y1:HPLOTX,Y
4 IF(J=0)GOTO 7:IF(I<10)GOTO5:IF(J=W0)GOTO6:J2=INT(J/10):IF((J/10)=J2)GOTO6
5 HCOLOR=0
6 HPLOT TOX,10*I+H1:HCOLOR=3:HPLOTX,Y
7 NEXTJ:NEXTI:HPLOTW+1,H:HPLOT TO101,H:HPLOT TO0+1,H1

Ungolfed version here.

When given input 1:

input-1

When given input 2:

input-2

Applesoft BASIC, 930 783 782 727 719 702 bytes

-72 bytes and a working program thanks to ceilingcat spotting my error and a shortened algorithm

0TEXT:HOME:INPUTS1:HGR:HCOLOR=3:W=279:H=159:W0=W-100:W1=W0/10:H1=H-100:H2=H-60:K=0.5:M=1/(2*3.14159265*S1*S1):FORI=0 TO10 STEPK:X=10*I+1:Y=10*I+H1:HPLOTX,Y:FORJ=0 TOW0 STEP1:J1=10*J/W0:D1=ABS(5-I):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):G=EXP(-R2)*M:A=INT((H2*G)/M):X=10*I+W1*J1+1:Y=10*I+H1-A:HPLOT TOX,Y:IF(I=0)GOTO4
1IF(J=W0)GOTO3
2J2=INT(J/10):IF((J/10)<>J2)GOTO5
3D1=ABS(5-I+K):D2=ABS(5-J1):R2=(D1*D1+D2*D2)/(2*S1*S1):U=EXP(-R2)/(2*3.14159*S1*S1):A1=INT((H2*U)/M):X1=10*(I-K)+W1*J1+1:Y1=10*(I-K)+H1-A1:HPLOT TOX1,Y1:HPLOTX,Y
4F(J=0)GOTO 7:IF(I<10)GOTO5:IF(J=W0)GOTO6:J2=INT(J/10):IF((J/10)=J2)GOTO6
5HCOLOR=0
6HPLOT TOX,10*I+H1:HCOLOR=3:HPLOTX,Y
7NEXTJ:NEXTI:HPLOTW+1,H:HPLOT TO101,H:HPLOT TO0+1,H1

Ungolfed version here.

When given input 1:

input-1

When given input 2:

input-2

added 106 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading
added 34 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading
deleted 294 characters in body
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading
golf kind of
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading
Source Link
MD XF
  • 13.9k
  • 4
  • 66
  • 104
Loading