Name: Anonymous 2020-03-05 1:56
Where is the repo?
RussophobiaOn the contrary, there's nothing irrational about it.
blueprint.gen_roads HM = fxn:
| W = HM.w
| H = HM.h
| RM = gfx W H
| MaxTries = 20
| NTries = 0
| RoadXYs = []
| while NTries++ < MaxTries:
| RM.clear{0}
| S,E = edge_endpoints W H
| Ps = @int: subdiv_line 4 [S E].float
| draw_lines RM #FF000000 &fat_line2 Ps
| Bridges = 0
| times Y H: times X W:
| when RM.get{X Y} and HM.get{X Y}&&d: Bridges++
| when Bridges > 12: pass
| push S,E RoadXYs
| times Y H: times X W:
| less RM.get{X Y}: pass //no road?
| V = HM.get{X Y}
| HV = V&&&#FF //height value
| if V&&̠ then //can't burrow through a cliff
| when HV > 4+CliffH:
| V <= (4+CliffH)+(V&&&#FFFFFF00) //FIXME: better solution
else
| when HV << 7: V <= 4+(V&&&#FFFFFF00)
| HM.set{X Y V---#200} //mark as road
| push X,Y RoadXYs
| RoadXYs <= RoadXYs.flip
| lower_road Arg =
| NChanges = 0
| for X,Y RoadXYs.tail:
| V = HM.get{X Y}
| VH = V&&&#FF
| Ns = Dirs{DX,DY => HM.get{X+DX Y+DY}}.skip{0}
| RNs = Ns.keep{?&&È}
| WNs = Ns.keep{?&&d}
| when V&&d: //water?
| when Arg: pass
| when RNs.count{?&&&#FF >< VH} > RNs.count{?&&&#FF <> VH}:
| less Ns.skip{?&&d}.has{?&&&#FF < VH}:
| pass //no potency for flood
| NewH = if VH><4
then
| Ms = Ns.skip{?&&d}
| when Ms.has{?&&&#FF >< VH}: pass //will flood through bridge
| VH+CliffH
else
| when V&&̠: V <= V +++ #800 //strip cliff flag
| VH-CliffH
| HM.set{X Y NewH+(V&&&#FFFFFF00)}
| NChanges++
| pass
| LowerZ = max 4 VH-2
| less WNs.end: LowerZ <= WNs{?&&&#FF}.min
| MinRNH = RNs{?&&&#FF}.min
| NewH = max LowerZ MinRNH
| when Arg:
| when RNs{?&&&#FF}.count{?>>VH}>1: NewH <= VH
| when NewH < VH:
| when WNs.any{(?&&&#FF) > NewH}: V <= V --- #100
| when V&&̠: V <= V +++ #800 //strip cliff flag
| HM.set{X Y NewH+(V&&&#FFFFFF00)}
| NChanges++
| NChanges
| lower_road 0
| times I 10: less lower_road 1: done
| Repeat = 1
| while Repeat--: for X,Y RoadXYs.tail: //create smooth descents
| V = HM.get{X Y}
//| when V&&d: pass //skip water
| HV = V&&&#FF
| when Dirs.any{DX,DY =>
| VV = HM.get{X+DX Y+DY}
| (VV&&È) and (VV&&&#FF)-HV > 1}:
| less Dirs.any{DX,DY => HM.get{X+DX Y+DY}&&d}: //ensure no flood
| HM.set{X Y (V+1)---#800}
| Repeat <= 1
| done
| RM.free
| RoadXYs
it has genuine potential, but it's made by an insane person (and not a cool insane person like Terry, just a sadistic bydlo)Working with him wouldn't be funny. I have to agree.
ulimit
it literally has only stack allocations because the bydlo is too dumb to implement a GCThat is actually the main language's idea.