I think I found two compiler bugs, one involving DRAW, both involving DEFFN functions. This gives incorrect results. wh% is the window height set by GET_GEOMETRY:
Workarounds were easy enough in Procedure Histogram:
#!/lbin/ybasic!Shamelesslyrippedoff,umm,Imeant,adapted,yeahyeahthat'stheticket,from,!https://hackaday.com/2020/06/23/boot-to-basic-box-packs-a-killer-graphics-engine/!Plus'tweaks'toseewhattheoriginalcutsofffromtheleft,top,andbottomProgramManglebrotOpenW1Pause0.05ClearWShowPageGet_Screensizesx%,sy%,sw%,sh%Get_Geometry1,wx%,wy%,ww%,wh%Print"Screen",sx%,sy%,sw%,sh%Print"Window",wx%,wy%,ww%,wh%maxx%=500!77w=ww%!240h=wh%!216hh=Int(h/2)maxCol=255!MapiterationcountstopurrtycolorpaletteDimmap%(maxx%)Fori%=0To99!BlacktoRed(Makefirstfewshadessupereasytodistinguish)map%(0+i%)=Color_RGB(Log1P((i%/99.0)*49.0)/Log(50.0),0,0)!RedtoVioletmap%(100+i%)=Color_RGB(1,0,i%/99.0)!ViolettoBluemap%(200+i%)=Color_RGB(1-i%/99.0,0,1)!BluetoAquamap%(300+i%)=Color_RGB(0,i%/99.0,1)!AquatoWhitemap%(400+i%)=Color_RGB(i%/99.0,1,1)Nexti%map%(0)=Color_RGB(0,0,0)!map%(1)=Color_RGB(1,0,0)!map%(2)=Color_RGB(0,1,0)!map%(3)=Color_RGB(0,0,1)map%(maxx%-1)=Color_RGB(1,1,1)!Aretheredifferencesinthevisibleareabetweenplatforms?ColorColor_RGB(0,1,0)PBox-1,-1,ww%+2,wh%+2!FlashthepaletteForx%=0Toww%-1i%=(1.0*x%/ww%)*(maxx%-1)Colormap%(i%)Drawx%,0Tox%,wh%-1ShowPageNextx%Pause1!Aretheredifferencesinthevisibleareabetweenplatforms?ColorColor_RGB(0,1,0)PBox-1,-1,ww%+2,wh%+2!SetuphistogramDimHist%(maxx%)ClrHist%()ClrHTot%!RefreshtimerClrPrevTime,CurrTime!PrevTime=STimerStart=CTimer!Let'sgooooForpy=0Tohhpy1=max(py,h-1-py)!Keepmagicnumbersasistomatchtheoriginalprogram!scaleY=(py/h)*2.0-1.0!andsimplykludgetheresulttoshowmoreofthe"hair"scaleY=Abs((py/hh)*1.15-1.15)CurrTime=STimerIf(CurrTime<>PrevTime)Or((hh-5)<py)@HistogramShowPageU$="########"PrintChr$(13);pyUsingU$;py1UsingU$;!h-pyUsingU$;PrintscaleYUsing"###.#########";" ";HTot%;ShowPagePrevTime=STimerEndIfForpx=0tow-1!IcanhazDOCONCURRENTplzcanI?!It'sjustajumptotheleft...!Keepmagicnumbersasistomatchtheoriginalprogram!scaleX=(px/w)*3.0-2.0!ForgetthatnoiselolscaleX=(px/w)*2.5-2.005Clri%,x,y!,vy,vxClrx2,y2Do!Pseudocodefrom,!https://en.wikipedia.org/wiki/Plotting_algorithms_for_the_Mandelbrot_set!shows"while (x2 + y2 ≤ 4 and..."Isthedifferencesignificant?!ExitIf4.0<=(x2+y2)ExitIf4.0<(x2+y2)xx=x2-y2+scaleXy=2.0*x*y+scaleYx=xxInci%ExitIfi%=maxx%x2=x*xy2=y*yLoop!col=MaxCol*i%/maxx%Colormap%(i%-1)Drawpx,pyTopx,py1!SynchupdatehistogramIncHist%(i%-1)IncHTot%NextpxNextpyShowPage!Histogram@HistogramShowPagePrintPrintwx%,wy%,ww%,wh%,hh,py,pxC=CTimer-StartPrintHTot%;" points in ";Round(C,2);" CPU seconds"PrintRound(HTot%/C,2);" points / CPU second"IfAndroid?Pause20EndIfPrintPrint"OK"EndProcedureHistogramLocalhh%,i%,HYhh%=Min(225,wh%/3)!BUG:Worksininterpreter,incorrectresultwhencompiled!DefFnHY(H)=wh%-1-Int(hh%*Log1P(H*999999.0)/Log(1000000.0))DefFnHY(H)=Int(wh%-1-Int(hh%*Log1P(H*999999.0)/Log(1000000.0)))ColorColor_RGB(0.2,0.2,0.2,0.5)PBox0,wh%-1,maxx%-1,@HY(1)ColorColor_RGB(0.5,0.5,0.5,0.5),Color_RGB(0,0,0,0)DefText1,0.05,0.06,0Fori%=0To10HY=@HY(i%/100000.0)Draw0,HYTomaxx%-1,HYHY=@HY(i%/10000.0)Draw0,HYTomaxx%-1,HYHY=@HY(i%/1000.0)Draw0,HYTomaxx%-1,HYHY=@HY(i%/100.0)Draw0,HYTomaxx%-1,HYHY=@HY(i%/10.0)Draw0,HYTomaxx%-1,HYNexti%LTextmaxx%+3,-4+@HY(1.0),"100 %"LTextmaxx%+3,-4+@HY(0.1),"10.0%"LTextmaxx%+3,-4+@HY(0.01),"1.00%"LTextmaxx%+3,-4+@HY(0.001),"0.10%"LTextmaxx%+3,-4+@HY(0.0001),"0.01%"LTextmaxx%+3,-5+@HY(0.00001),"0.001%"HY=@HY(0.0000025)Draw0,HYTomaxx%-1,HYLTextmaxx%+3,HY-5,"0.00025%"HY=@HY(0.0000001)Draw0,HYTomaxx%-1,HYLTextmaxx%+3,wh%-7,"0.00001%"IfHTot%>0Fori%=1Tomaxx%If0<Hist%(maxx%-i%)Colormap%(maxx%-i%)!BUG:Worksininterpreter,"Function HY not defined"whencompiled!Drawi%-1,wh%-1Toi%-1,@HY(1.0*Hist%(maxx%-i%)/HTot%)HY=@HY(1.0*Hist%(maxx%-i%)/HTot%)Drawi%-1,wh%-1Toi%-1,HYEndIfNexti%EndIfReturn
I think I found two compiler bugs, one involving DRAW, both involving DEFFN functions. This gives incorrect results. wh% is the window height set by GET_GEOMETRY:
hh% = Min(225, wh% / 3)
DefFn HY(H) = wh% - 1 - Int(hh% * Log1P(H * 999999.0) / Log(1000000.0))
This compiles but fails with "Function HY not defined" when run:
Draw i% - 1, wh% - 1 To i% - 1, @HY(1.0 * Hist%(maxx% - i%) / HTot%)
Workarounds were easy enough in Procedure Histogram: