Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

10
LINES

< > BotCompany Repo | #1014955 // varyPoint (varyPt)

JavaX fragment (include)

static Pt varyPoint(Pt p, int w, int h) {
  ret tossACoin() ? randomPoint(w, h) : varyPoint(p, 10);
}

static Pt varyPoint(Pt p, int range) {
  range = max(range, 1);
  ret new Pt(
    random_incl(p.x-range, p.x+range),
    random_incl(p.y-range, p.y+range));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mowyntqkapby, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1014955
Snippet name: varyPoint (varyPt)
Eternal ID of this version: #1014955/3
Text MD5: 3de8e23dba7181560f787bb92d76516f
Author: stefan
Category: javax / a.i.
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-03-13 05:36:57
Source code size: 272 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 305 / 357
Version history: 2 change(s)
Referenced in: [show references]