/    Sign up×
Community /Pin to ProfileBookmark

graphics: keystroke simplification routine

Graphics program written in Javascript for webpage: simplify keystrokes

There are a lot of keystrokes involved in making a color move from one position to the next.

legPos[0]=new Array(0,LD,LD,LD,LD,LD,LD,LD,LD,LD,LD,LD,LD,L)
//legPos where [0] is relative to the body and each “LD” is relative to the previous part of the leg. ie) The knee joint is 6 LD’s down from 0.

openingLGS=new Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,2,0,0,22,0)
//openingLGS describes the movement of the legPos

as you can see, there is much repetitive keystroking.

LASOrder=openingLGS.concat(stall1LGS)
//concat arrays to prevent huge lines of instructions. LASOrder puts the segments together; where stall1LGS represents an array of 15 zeros.

Still I had to type the stall1LGS array initially and it only useful when I need 15 zeros.

Maybe you can help with this part. I could use a time saver. I need an array that gives an increment of “0” to the previous array position.

n0=[]
n0[0]=[0]
n0[1]=[0,0]
n0[2]=[0,0,0]

thru a fifty count. It looks like an easy loop, but I’m struggling with it. And, really it’s not ideal because I’ll have to keystroke stroke brackets. The best I can come up with is to make an alphanumeric N012 represent 12 zeros.

Any script help/advice is appreciated.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @blackbudd spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...