Original Usenet thread from alt.ascii-art, started 19 Jan 1998.
Cantering MOOSE / anyone do gaits?
alt.ascii-art
· 15 messages · 19 Jan 1998 - 30 Jan 1998
Enclosed is an amination of a moose cantering; to view, save and
browse as an HTML file.
Has anyone done an animation of animals showing all the real-life
four legged walking patterns ("gaits"), which can all be observed
in domestic cats if you have cats at home.
(A) SLOW WALK. The legs act in diagonally opposite pairs:
1. LeftRear forward 2 RightFront 3 RightRear 4 RightFront,
in four time units the animal is one pace forward.
(B) TROT. If it was a pantomime horse the front and back back
pairs would be exactly _out_of_ step i.e. the legs on the left
side scissor inwards as the legs on the right side scissor
outwards, then oppositely. The diagonally opposite pairs that
are _out_ do the work, hitting the ground and swinging over the
foot then lifting off the ground in their furthest back position.
(C) CANTER. The left front and rear go forward in step as the
right front and rear go back in step, so there's a definite
side to side sway.
(D) GALLOP. Both rear legs scissor forward together as both front
legs scissor back together, the forward legs hit the ground and
swing over the foot raising off the ground at the rearmos position
and swinging forward for the next stride.
A-B-C-D are increasingly fast and demanding of energy.
There is also (E) FOUR LEGGED HOP [PRONKING]. Speaks for itself:
hop vertically in the air on all foutr legs at once.
######################################################
<html>
<head>
<title>Cantering MOOSE, by Xemu</title>
</head>
<!-- SCRIPT FOR ANIMATION -->
<script language="JavaScript">
var max=0; // FUNCTION TO SET UP FRAMES
function tlist(){ max=tlist.arguments.length;
for(i=0;i<max;i++) this[i]=tlist.arguments[i];
}
tl=new tlist( // \=escape char \\=prints backslash
//01234567890123456789012345678901234567890 frame[00]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" || || \r\n"+
" || || \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[01]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" /\\\\ /\\\\ \r\n"+
" // \\\\ // \\\\ \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[02]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" || || \r\n"+
" || || \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[03]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" //\\ //\\ \r\n"+
" // \\\\ // \\\\ \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[04]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" || || \r\n"+
" || || \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[05]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" /\\\\ /\\\\ \r\n"+
" // \\\\ // \\\\ \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[06]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" || || \r\n"+
" || || \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[07]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" //\\ //\\ \r\n"+
" // \\\\ // \\\\ \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[08]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" || || \r\n"+
" || || \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[09]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" /\\\\ /\\\\ \r\n"+
" // \\\\ // \\\\ \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[10]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" || || \r\n"+
" || || \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[11]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" //\\ //\\ \r\n"+
" // \\\\ // \\\\ \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[12]
" ^-^-@@-^-^ \r\n"+
" \ (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" || || \r\n"+
" || || \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[13]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" /\\\\ /\\\\ \r\n"+
" // \\\\ // \\\\ \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[14]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" || || \r\n"+
" || || \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[15]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" //\\ //\\ \r\n"+
" // \\\\ // \\\\ \r\n"+
" '' '' \r\n",
//01234567890123456789012345678901234567890 frame[16]
" ^-^-@@-^-^ \r\n"+
" : (..) \r\n"+
" +-------// \r\n"+
" |_______| \r\n"+
" || || \r\n"+
" || || \r\n"+
" '' '' \r\n"
);
var x=0; // FUNCTION TO DISPLAY FRAMES IN SEQUENCE
function tick() {
document.f.t.value=tl[x];
x++; if(x==max) x=0;
//if(confirm('continue?'))
setTimeout("tick()",105);
}
</script>
<!-- END SCRIPT-->
<!-- Body, runs above script on loading -->
<body onload="tick()"
LINK="0000FF" ALINK="339900" VLINK="33CC33" HLINK="CC0000"
BGCOLOR="000000" TEXT="FFFFFF"
>
<!-- This is the form and textarea the script accesses -->
<FORM NAME=f>
<TEXTAREA NAME=t ROWS=8 COLS=60 BGCOLOR=000000 TEXT=FFFFFF>
</TEXTAREA>
</FORM>
</body>
</html>
|~/ |~/
~~|;'^';-._.-;'^';-._.-;'^';-._.-;'^';-._.-;||';-._.-;'^';||_.-;'^'0-|~~
P | Woof Woof, Glug Glug ||____________|| 0 | P
O | Who Drowned the Judge's Dog? | . . . . . . . '----. 0 | O
O | answers on *---|_______________ @__o0 | O
L |{a href="news:alt.religion.scientology"}{/a}_____________|/_______| L
and{a href="http://www.xemu.demon.co.uk/clam/lynx/q0.html"}{/a}XemuSP4(:)
I'll try this again; please accept my apologies if this is the second time you are seeing this article. In article <CJ9...@xemu.demon.co.uk>, Dave Bird---St Hippo of Augustine <Dev...@xemu.demon.co.uk> wrote: > > Enclosed is an amination of a moose cantering; to view, save and > browse as an HTML file. > > Has anyone done an animation of animals showing all the real-life > four legged walking patterns ("gaits"), which can all be observed > in domestic cats if you have cats at home. > > (A) SLOW WALK. The legs act in diagonally opposite pairs: > 1. LeftRear forward 2 RightFront 3 RightRear 4 RightFront, > in four time units the animal is one pace forward. > > (B) TROT. If it was a pantomime horse the front and back back > pairs would be exactly _out_of_ step i.e. the legs on the left > side scissor inwards as the legs on the right side scissor > outwards, then oppositely. The diagonally opposite pairs that > are _out_ do the work, hitting the ground and swinging over the > foot then lifting off the ground in their furthest back position. > > (C) CANTER. The left front and rear go forward in step as the > right front and rear go back in step, so there's a definite > side to side sway. > > (D) GALLOP. Both rear legs scissor forward together as both front > legs scissor back together, the forward legs hit the ground and > swing over the foot raising off the ground at the rearmos position > and swinging forward for the next stride. > > A-B-C-D are increasingly fast and demanding of energy. > > There is also (E) FOUR LEGGED HOP [PRONKING]. Speaks for itself: > hop vertically in the air on all foutr legs at once. [animation snipped] > L |{a href="news:alt.religion.scientology"}{/a}_____________|/_______| L > and{a href="http://www.xemu.demon.co.uk/clam/lynx/q0.html"}{/a}XemuSP4(:) . ___ / ha _/ | \,^%--- ha |_____| <_ \ ha That moose is going nowhere fast. --- == >/ [_____] __>,^ ejm97 | | //| | You should really turn the poor thing around so it doesn't suddenly and inexplicably beam itself back to the starting point. As to the gait animation, I'll think seriously about it. Watch alt.ascii-art.animation for news of how I've gotten on with it. NOTE: If you hit the reply button, add an "e" to the "freent"; its absense is to stop the torment of automatic mailers. -- ___ www.geocities.com/SoHo/Studios/9334/animations.htm _/ | ,^%--- cq5...@freenet.toronto.on.ca |_____| __<_ \ I only llizard aka ejm --- == >/ posted this [_____] __>,^ in alt.ascii-art because | | //| | I have a horror of crossposting.
In article <34C...@freent.toronto.on.ca>, llizard writes: >In article <CJ9...@xemu.demon.co.uk>, Dave Bird wrote: >> >> Enclosed is an amination of a moose cantering; to view, save and >> browse as an HTML file. >> >> Has anyone done an animation of animals showing all the real-life >> four legged walking patterns ("gaits"), which can all be observed >> in domestic cats if you have cats at home. >> (A) SLOW WALK. The legs act in diagonally opposite pairs: >> 1. LeftRear forward 2 RightFront 3 RightRear 4 RightFront, >> in four time units the animal is one pace forward. >> >>[snip other gaits..........] > >You should really turn the poor thing around so it doesn't suddenly and >inexplicably beam itself back to the starting point. Can the Basic below be done in JavaScript i.e. the array stores not FRAMES but LINES, and a frame is built dynamically from lines (don't know how slow this would be), thus eliminating lots of frames which are just the same object 4,8,12 etc spaces rightwards? The animation shows a little dog doing the slow quadruped walk. ANIM8.BAS ========= NROW = 7: CLS DIM PK$(NROW) GOSUB 1200 STOP REM MMM MMM REM M +++++++++++++++++++++++++++++++++++++++++++++++++++++ M REM MMM MMM 1200 NDELAY = 5000: REM version three animation player FOR IREPT = 1 TO 10: NTOP = 57: LB = 24: CLS FR$ = "": BK$ = " " FOR IPLAC = 1 TO NTOP STEP 4: JPLAC = NTOP - IPLAC: RESTORE FOR IFRAM = 1 TO 4: CLS : PRINT IPLAC, NTOP, JPLAC FOR R = 1 TO NROW: READ A$ IF IPLAC < LB THEN A$ = RIGHT$(A$, IPLAC) ELSE IF JPLAC < LB THEN A$ = LEFT$(A$, JPLAC) PRINT FR$; A$; BK$ NEXT R: FOR DLY = 1 TO NDELAY: NEXT DLY NEXT IFRAM: IF IPLAC > LB THEN FR$ = FR$ + " ": IF LEN(BK$) > 4 THEN BK$ = MID$(BK$, 4) NEXT IPLAC: NDELAY = NDELAY - 450 NEXT IREPT RETURN REM ---- REM ..........Data statements........................ REM Walk[1] single legs advance in cyclic order ---+ REM 0000000000111111111122222 W[1] REM 0123456789012345678901234 DATA "\\ /\ " DATA " \\__________/ @--o " DATA " | === " DATA " | _________ .'' " DATA " | |+\ | |+| " DATA " | |\#\ | |+| " DATA ".|_|.'-' .|_|-' " REM 0000000000111111111122222 W[2] REM 0123456789012345678901234 DATA " |\ /\ " DATA " \\_________/ @--o " DATA " | === " DATA " | ________ .'' " DATA " | |+| | |+| " DATA " / /\+\ \#\/ " DATA " .|_|'-' ___|_| " REM 0000000000111111111122222 W[3] REM 0123456789012345678901234 DATA " |\ /\ " DATA " \\_________/ @--o " DATA " | === " DATA " | ________ .'' " DATA " \ \+| | |+| " DATA " \#\\ \ \/ " DATA " ___\_\ _|_| " REM 0000000000111111111122222 W[4] REM 0123456789012345678901234 DATA " \\ /\ " DATA " \\_________/ @--o" DATA " | ===" DATA " | _________ .''" DATA " \ \+| | |+| " DATA " | |+| | |#| " DATA " _\_\' ..|_|-' " END ~~~~~~~~~~~~~~~~~~~~~~~~JAVASCRIPT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Does JavaScript have basic-style string variables, concatenate, and left$/right$/mid$? can you do a bitwise and of variables?? var max=0; //function to set up a list of strings function tlist(){ max=tlist.arguments.length; for(i=0;i<max;i++) this[i]=tlist.arguments[i]; } list1=new tlist( "\\ /\ \r\n", //W[1] " \\__________/ @--o \r\n", " | === \r\n", " | _________ .'' \r\n", " | |+\ | |+| \r\n", " | |\#\ | |+| \r\n", ".|_|.'-' .|_|-' \r\n", " \r\n", " |\ /\ \r\n", //W[2] " \\_________/ @--o \r\n", " | === \r\n", " | ________ .'' \r\n", " | |+| | |+| \r\n", " / /\+\ \#\/ \r\n", " .|_|'-' ___|_| \r\n", " \r\n", " \r\n", " |\ /\ \r\n", //W[3] " \\_________/ @--o \r\n", " | === \r\n", " | ________ .'' \r\n", " \ \+| | |+| \r\n", " \#\\ \ \/ \r\n", " ___\_\ _|_| \r\n", " \r\n", " \\ /\ \r\n", //W[4] " \\_________/ @--o\r\n", " | ===\r\n", " | _________ .''\r\n", " \ \+| | |+| \r\n", " | |+| | |#| \r\n", " _\_\' ..|_|-' \r\n" ); There are 0x08 lines in a frame, * 0x04 frames (=0x20), * 0x10 steps of fourspace advance (=0x200) in an 0x40 char line. |~/ |~/ ~~|;'^';-._.-;'^';-._.-;'^';-._.-;'^';-._.-;||';-._.-;'^';||_.-;'^'0-|~~ P | Woof Woof, Glug Glug ||____________|| 0 | P O | Who Drowned the Judge's Dog? | . . . . . . . '----. 0 | O O | answers on *---|_______________ @__o0 | O L |{a href="news:alt.religion.scientology"}{/a}_____________|/_______| L and{a href="http://www.xemu.demon.co.uk/clam/lynx/q0.html"}{/a}XemuSP4(:)
Please excuse me if this is the second time you are seeing this article (newsserver problems - again/still) In article <PBk...@xemu.demon.co.uk>, Dave Bird---St Hippo of Augustine <new...@xemu.demon.co.uk> wrote: > > In article <34C...@freent.toronto.on.ca>, llizard writes: > >In article <CJ9...@xemu.demon.co.uk>, Dave Bird wrote: > >> > >> Enclosed is an amination of a moose cantering; to view, save and > >> browse as an HTML file. > >> > >> Has anyone done an animation of animals showing all the real-life > >> four legged walking patterns ("gaits"), which can all be observed > >> in domestic cats if you have cats at home. > >> (A) SLOW WALK. The legs act in diagonally opposite pairs: > >> 1. LeftRear forward 2 RightFront 3 RightRear 4 RightFront, > >> in four time units the animal is one pace forward. > >> > >>[snip other gaits..........] > > > >You should really turn the poor thing around so it doesn't suddenly and > >inexplicably beam itself back to the starting point. > > Can the Basic below be done in JavaScript i.e. the array stores > not FRAMES but LINES, and a frame is built dynamically from lines > (don't know how slow this would be), thus eliminating lots of > frames which are just the same object 4,8,12 etc spaces rightwards? > The animation shows a little dog doing the slow quadruped walk. > [snip of basic] > ~~~~~~~~~~~~~~~~~~~~~~~~JAVASCRIPT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Does JavaScript have basic-style string variables, concatenate, > and left$/right$/mid$? can you do a bitwise and of variables?? [snip] > var max=0; //function to set up a list of strings > function tlist(){ max=tlist.arguments.length; > for(i=0;i<max;i++) this[i]=tlist.arguments[i]; > } > list1=new tlist( > "\\ /\ \r\n", //W[1] > " \\__________/ @--o \r\n", > " | === \r\n", > " | _________ .'' \r\n", > " | |+\ | |+| \r\n", > " | |\#\ | |+| \r\n", > ".|_|.'-' .|_|-' \r\n", [snip of rest of dogs] Oh my. Why don't you take a look at my javascript ascii-animation template? It is not difficult to decipher and is located at http://www.geocities.com/SoHo/Studios/9334/animlesson.htm NOTE: If you hit the reply button, add an "e" to the "freent"; its absense is to stop the torment of automatic mailers. -- ___ www.geocities.com/SoHo/Studios/9334/animations.htm _/ | ,^%--- cq5...@freenet.toronto.on.ca |_____| __< \ Have llizard aka ejm --- == -- > you [_____] __>,^ seen my ejm97| | //| | walking horse?
In article <34C...@freent.toronto.on.ca>, llizard <cq5...@freent.toronto.on.ca> writes >Oh my. Why don't you take a look at my javascript ascii-animation >template? > >It is not difficult to decipher and is located at > >http://www.geocities.com/SoHo/Studios/9334/animlesson.htm Ah; misses the point. To do this properly--especially the big dog with jointed legs on an 8 frame cycle--you have to build the rows dynamically rather than have duplicate frames for frame, frame moved N spaces right, frame moved 2N spaces right, etc. |~/ |~/ ~~|;'^';-._.-;'^';-._.-;'^';-._.-;'^';-._.-;||';-._.-;'^';||_.-;'^'0-|~~ P | Woof Woof, Glug Glug ||____________|| 0 | P O | Who Drowned the Judge's Dog? | . . . . . . . '----. 0 | O O | answers on *---|_______________ @__o0 | O L |{a href="news:alt.religion.scientology"}{/a}_____________|/_______| L and{a href="http://www.xemu.demon.co.uk/clam/lynx/q0.html"}{/a}XemuSP4(:)
Dave Bird---St Hippo of Augustine wrote: > > In article <34C...@freent.toronto.on.ca>, llizard writes: > >In article <CJ9...@xemu.demon.co.uk>, Dave Bird wrote: > >> > >> Enclosed is an amination of a moose cantering; to view, save and > >> browse as an HTML file. > >> > >> Has anyone done an animation of animals showing all the real-life > >> four legged walking patterns ("gaits"), which can all be observed > >> in domestic cats if you have cats at home. > >> (A) SLOW WALK. The legs act in diagonally opposite pairs: > >> 1. LeftRear forward 2 RightFront 3 RightRear 4 RightFront, > >> in four time units the animal is one pace forward. > >> > >>[snip other gaits..........] > > > >You should really turn the poor thing around so it doesn't suddenly and > >inexplicably beam itself back to the starting point. > > Can the Basic below be done in JavaScript i.e. the array stores > not FRAMES but LINES, and a frame is built dynamically from lines > (don't know how slow this would be), thus eliminating lots of > frames which are just the same object 4,8,12 etc spaces rightwards? > The animation shows a little dog doing the slow quadruped walk. > [snip basic source] > > ~~~~~~~~~~~~~~~~~~~~~~~~JAVASCRIPT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > Does JavaScript have basic-style string variables, concatenate, > and left$/right$/mid$? can you do a bitwise and of variables?? > Yes, Yes, ??? and Yes. JavaScript variables have no type, you can just do: var str; // not really required either. str="Hello, world!"; or str=1; or str=true; or whatever. Concatenate: var str1,str2,str3; str1="Hello,"; str2="world!"; str3=str1+str2; or str1+=str2 // for non C-people: equal to str1=str1+str2 I'm not too familiar with basic, what does left$/mid$/right$ do or mean? bitwise and: var a,b,c; a=23475; b=43556; c=a & b; or a&=b; So, a script that dynamically builds up frames: [snip from here ---> <HTML> <HEAD><TITLE>Dynamically build up frames</TITLE></HEAD> <BODY> <FORM NAME=f> <TEXTAREA NAME=t ROWS=8 COLS=60> </TEXTAREA> </FORM> <SCRIPT LANGUAGE="JavaScript"> function MakeArray() { for (i=0;i<MakeArray.arguments.length;i++) this[i]=MakeArray.arguments[i]; } // make the first frame: (the reason it looks distorted is because all \'s // have been replaced by \\'s) frame=new Array(4); frame[0] = new MakeArray( "\\\\ /\\ \r\n", " \\\\__________/ @--o \r\n", " | === \r\n", " | _________ .'' \r\n", " | |+\\ | |+| \r\n", " | |\\#\\ | |+| \r\n", ".|_|.'-' .|_|-' \r\n", " \r\n" ); frame[1] = new MakeArray( " |\\ /\\ \r\n", " \\\\_________/ @--o \r\n", " | === \r\n", " | ________ .'' \r\n", " | |+| | |+| \r\n", " / /\\+\\ \\#\\/ \r\n", " .|_|'-' ___|_| \r\n", " \r\n", " \r\n" ); frame[2] = new MakeArray( " |\\ /\\ \r\n", " \\\\_________/ @--o \r\n", " | === \r\n", " | ________ .'' \r\n", " \\ \\+| | |+| \r\n", " \\#\\\\ \\ \\/ \r\n", " ___\\_\\ _|_| \r\n", " \r\n" ); frame[3] = new MakeArray( " \\\\ /\\ \r\n", " \\\\_________/ @--o\r\n", " | ===\r\n", " | _________ .''\r\n", " \\ \\+| | |+| \r\n", " | |+| | |#| \r\n", " _\\_\\' ..|_|-' \r\n", " \r\n" ); // OK, we now have 4 frames (frame[0] trough frame[3]) which all contain // 8 lines (frame[X][0] through frame[X][7]). lets do the animating: var loop=0; var count=0; function animate() { var str=""; // variable in which we build up the frame. for (x=0;x<8;x++) { for (y=0;y<loop;y++) { str+=" "; // loop times four spaces in front of each line } str+=frame[count][x]; } document.f.t.value=str; count++; // increase frame; if (count==4) { count=0; loop++; loop%=10; } setTimeout("animate()",60); } animate(); </SCRIPT> </BODY> </HTML> <-- until here ] Script tested and it worked. You can see it on: http://fmf.ml.org/~shimrod/asciiart/dynamic.html Greetz, -- (`. ____________________________ \ `. / __/ / / / /_ / /_ / ) `._..---._ \__ \ \ \ \_\ \ \ \ \_\ \ \`. __...---` o ) /___/_/_/_/_/ /_/_/_/___/___/ \ `._,--' , ___,' Herman Hiddema ---------------------- ) ,-._ \ ) _,-' ----------- mailto:shi...@fmf.ml.org /,' ``--.._____\/--'' http://fmf.ml.org/~shimrod ----------
.------- Shimrod <csg...@wing.rug.nl> wrote...
|
| I'm not too familiar with basic, what does left$/mid$/right$ do or mean?
|
'------------------------------
LEFT$ takes the leftmost characters from a string
eg: n$=LEFT$("Hello",2)
n$ will equal "He"
RIGHT$ is the same, but for the right of the string.
MID$ can be used to take part of a string from the middle:
eg: n$=MID$("Hello",2,2)
n$ will equal "el"
Try this ickle QBasic prog:
* sc$=SPACE$(80)+"This is a little QBasic program to demonstrate MID$ and
what it can be used for.... created by Martin Atkins
(mar...@bigfoot.com)"+SPACE$(1)
* FOR q=1 to LEN(sc$)
* m$=MID$(sc$,q,79)
* LOCATE 1,1 : PRINT m$
* FOR del=1 to 180 : NEXT
* NEXT
Don`t put in the *`s - they are just there to indicate a new line. If my
Newsreader wraps this (which it probably will), you will need to stick the
long lines back together.
||||| __________________________________________
|||( O| / IF ELSE ENDIF GOTO THEN PRINT INPUT... /
||| > _____/ ______________________________________/
| <| /________/ \
\__/ | | | I`ve got to stop using QBasic
| | | | | so much.... :)
/ " \ __ |____|__|
|\\ |/.-' _.|______|__| mga
| \\// """""""""""""
--
_
____.Martin Atkins AKA mga.____ / |
""""-mar...@bigfoot.com-"""" / |
___________________________________/___|_
__/___| o o o o o o o o o o o A _______
| _-"
-________________\ \____________-"
\_____\ mga
In article <34C...@wing.rug.nl>, Shimrod <csg...@wing.rug.nl> wrote: > > Dave Bird---St Hippo of Augustine wrote: > > [snip] > > Can the Basic below be done in JavaScript i.e. the array stores > > not FRAMES but LINES, and a frame is built dynamically from lines > > (don't know how slow this would be), thus eliminating lots of > > frames which are just the same object 4,8,12 etc spaces rightwards? > > The animation shows a little dog doing the slow quadruped walk. > > > > [snip basic source] > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~JAVASCRIPT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > Does JavaScript have basic-style string variables, concatenate, > > and left$/right$/mid$? can you do a bitwise and of variables?? > > > > Yes, Yes, ??? and Yes. > > JavaScript variables have no type, you can just do: > > var str; // not really required either. > str="Hello, world!"; or str=1; or str=true; or whatever. > > Concatenate: > var str1,str2,str3; > str1="Hello,"; > str2="world!"; > str3=str1+str2; or str1+=str2 // for non C-people: equal to > str1=str1+str2 > > I'm not too familiar with basic, what does left$/mid$/right$ do or mean? > > bitwise and: > > var a,b,c; > a=23475; > b=43556; > c=a & b; or a&=b; > > So, a script that dynamically builds up frames: > > [snip from here ---> > > <HTML> > <HEAD><TITLE>Dynamically build up frames</TITLE></HEAD> > <BODY> > > <FORM NAME=f> > <TEXTAREA NAME=t ROWS=8 COLS=60> > </TEXTAREA> > </FORM> > > <SCRIPT LANGUAGE="JavaScript"> > > function MakeArray() { > for (i=0;i<MakeArray.arguments.length;i++) > this[i]=MakeArray.arguments[i]; > } > > // make the first frame: (the reason it looks distorted is because all > \'s > // have been replaced by \\'s) > > frame=new Array(4); > > frame[0] = new MakeArray( > "\\\\ /\\ \r\n", > " \\\\__________/ @--o \r\n", > " | === \r\n", > " | _________ .'' \r\n", > " | |+\\ | |+| \r\n", > " | |\\#\\ | |+| \r\n", > ".|_|.'-' .|_|-' \r\n", > " \r\n" > ); > > frame[1] = new MakeArray( > " |\\ /\\ \r\n", > " \\\\_________/ @--o \r\n", > " | === \r\n", > " | ________ .'' \r\n", > " | |+| | |+| \r\n", > " / /\\+\\ \\#\\/ \r\n", > " .|_|'-' ___|_| \r\n", > " \r\n", > " \r\n" > ); > > frame[2] = new MakeArray( > " |\\ /\\ \r\n", > " \\\\_________/ @--o \r\n", > " | === \r\n", > " | ________ .'' \r\n", > " \\ \\+| | |+| \r\n", > " \\#\\\\ \\ \\/ \r\n", > " ___\\_\\ _|_| \r\n", > " \r\n" > ); > > frame[3] = new MakeArray( > " \\\\ /\\ \r\n", > " \\\\_________/ @--o\r\n", > " | ===\r\n", > " | _________ .''\r\n", > " \\ \\+| | |+| \r\n", > " | |+| | |#| \r\n", > " _\\_\\' ..|_|-' \r\n", > " \r\n" > ); > > // OK, we now have 4 frames (frame[0] trough frame[3]) which all contain > // 8 lines (frame[X][0] through frame[X][7]). lets do the animating: > > var loop=0; > var count=0; > > function animate() { > var str=""; // variable in which we build up the frame. > for (x=0;x<8;x++) { > for (y=0;y<loop;y++) { > str+=" "; // loop times four spaces in front of each line > } > str+=frame[count][x]; > } > document.f.t.value=str; > count++; // increase frame; > if (count==4) { > count=0; > loop++; > loop%=10; > } > setTimeout("animate()",60); > } > > animate(); > > </SCRIPT> > </BODY> > </HTML> > > <-- until here ] > > Script tested and it worked. You can see it on: > http://fmf.ml.org/~shimrod/asciiart/dynamic.html > > Greetz, > -- > (`. ____________________________ > \ `. / __/ / / / /_ / /_ / > ) `._..---._ \__ \ \ \ \_\ \ \ \ \_\ \ > \`. __...---` o ) /___/_/_/_/_/ /_/_/_/___/___/ > \ `._,--' , ___,' Herman Hiddema ---------------------- > ) ,-._ \ ) _,-' ----------- mailto:shi...@fmf.ml.org > /,' ``--.._____\/--'' http://fmf.ml.org/~shimrod ---------- It sort of worked for me. It worked better after I removed "(the reason it looks distorted is because all \'s // have been replaced by \\'s)" That little dog looks awfully stiff though and should walk right out of the window and back in the other direction if the animation is going to be on a continual loop. Of course, it STILL doesn't work in MSIE 3.0 because of the proportional font in the window. NOTE: If you hit the reply button, add an "e" to the "freent"; its absense is to stop the torment of automatic mailers. -- ,^ llizard aka ejm ---%^^^^^^^^^^^^^ cq5...@freenet.toronto.on.ca / " " www.geocities.com/SoHo/Studios/9334/
llizard wrote in message <34C...@freent.toronto.on.ca>... >Of course, it STILL doesn't work in MSIE 3.0 because of the proportional >font in the window. Of course, Microsoft would say "You're not supposed to have IE3, you're supposed to have upgraded to 4.01 already! It's free! whatcha waiting for?" ...Er, my point is, IE3.x will always have the bad box. And I do believe it is fixed in IE4.x. >>BKNambo, <x> Microsoft itself.. -- http://come.to/brocks.place | World Domination Through Trivia! "Lemming is the eternal force of life." --from the online weeding of Dee-Bee and Br_Lee_Luuuuuurve
In article <37o...@xemu.demon.co.uk>, Dave Bird---St Hippo of Augustine <Dev...@xemu.demon.co.uk> wrote: > > In article <34C...@freent.toronto.on.ca>, llizard > <cq5...@freent.toronto.on.ca> writes > >Oh my. Why don't you take a look at my javascript ascii-animation > >template? > > > >It is not difficult to decipher and is located at > > > >http://www.geocities.com/SoHo/Studios/9334/animlesson.htm > > Ah; misses the point. To do this properly--especially the big dog > with jointed legs on an 8 frame cycle--you have to build the rows > dynamically rather than have duplicate frames for > frame, frame moved N spaces right, frame moved 2N spaces right, etc. It's all coming clear to me now. I put your frames into my scripting and came up with errors because it didn't like all those \r\n", and really didn't like the lack of \r\n"+ at the end of each line. I laboriously (can you tell I know NOTHING of programming?) write out the frames. Sorry to have misunderstood. NOTE: If you hit the reply button, add an "e" to the "freent"; its absense is to stop the torment of automatic mailers. -- ,~ www.geocities.com/SoHo/Studios/9334/ ~/(\ ,^^%--- cq5...@freenet.toronto.on.ca ~ ______~// `. _/< \ llizard aka ejm ~~~( )___( | `..' < Your way would |/ \|| ^^|\ have made things a lot easier when I |' |' ejm98 // was doing the llizard/horse animation.
llizard wrote: > > In article <34C...@wing.rug.nl>, Shimrod <csg...@wing.rug.nl> > wrote: > > [snip Javascript and other programming] > > > > Script tested and it worked. You can see it on: > > http://fmf.ml.org/~shimrod/asciiart/dynamic.html > > > > It sort of worked for me. It worked better after I removed > > "(the reason it looks distorted is because all > \'s > // have been replaced by \\'s)" > Oops, my newsreader wrapped that, sorry. The \'s was supposed to be on the previous line, safely inside a JavaScript comment. > That little dog looks awfully stiff though and should walk right out > of the window and back in the other direction if the animation is > going to be on a continual loop. That's possible, it would require 4 more frames of the door the other way round. I've done something like that on: http://fmf.ml.org/~shimrod/asciiart/traffic.html I took the cars Marijn Kampf made, and made an animation which constantly adds random cars at the beginning. > Of course, it STILL doesn't work in MSIE 3.0 because of the > proportional font in the window. > Greetz, -- (`. ____________________________ \ `. / __/ / / / /_ / /_ / ) `._..---._ \__ \ \ \ \_\ \ \ \ \_\ \ \`. __...---` o ) /___/_/_/_/_/ /_/_/_/___/___/ \ `._,--' , ___,' Herman Hiddema ---------------------- ) ,-._ \ ) _,-' ----------- mailto:shi...@fmf.ml.org /,' ``--.._____\/--'' http://fmf.ml.org/~shimrod ----------
Sigh, I'll try this again. Please accept my apologies if you are seeing this a second time. (Newsserver problems again/still) In article <37o...@xemu.demon.co.uk>, Dave Bird---St Hippo of Augustine <Dev...@xemu.demon.co.uk> wrote: > > In article <34C...@freent.toronto.on.ca>, llizard > <cq5...@freent.toronto.on.ca> writes > >Oh my. Why don't you take a look at my javascript ascii-animation > >template? > > > >It is not difficult to decipher and is located at > > > >http://www.geocities.com/SoHo/Studios/9334/animlesson.htm > > Ah; misses the point. To do this properly--especially the big dog > with jointed legs on an 8 frame cycle--you have to build the rows > dynamically rather than have duplicate frames for > frame, frame moved N spaces right, frame moved 2N spaces right, etc. It's all coming clear to me now. I put your frames into my scripting and came up with errors because it didn't like all those \r\n", and really didn't like the lack of \r\n"+ at the end of each line. I laboriously (can you tell I know NOTHING of programming?) write out the frames. Sorry to have misunderstood. NOTE: If you hit the reply button, add an "e" to the "freent"; its absense is to stop the torment of automatic mailers. -- ,~ www.geocities.com/SoHo/Studios/9334/ ~/(\ ,^^%--- cq5...@freenet.toronto.on.ca ~ ______~// `. _/< \ llizard aka ejm ~~~( )___( | `..' < Your way would |/ \|| ^^|\ have made things a lot easier when I |' |' ejm98 // was doing the llizard/horse animation.
In article <XrL...@xemu.demon.co.uk>, Dave Bird---St Hippo of Augustine <Dev...@xemu.demon.co.uk> wrote: > > In article <34C...@freent.toronto.on.ca>, llizard > <cq5...@freent.toronto.on.ca> writes > >That little dog looks awfully stiff though and should walk right out of > >the window and back in the other direction if the animation is going to > >be on a continual loop. > > OK, bite the bullet, here is the 'C++' animation of the doggie: > it has jointed legs which hit the gound and turn with the foot > in a fixed postion moving the body forward then swing over with > claws above the ground on the off-stroke. It is done with a > nominal "sprite window" of the doggie which slides onto the edge > of the physical display window (so it appears nose first), moves > across, then slides off the far edge (so it vanishes tail last). > > The speed smoothly accelerates/decelerates with transitions > from walk to trot to canter to gallop, and on the gallop its bum > goes up in the air when its two back legs leave the ground. It > might be an idea to also have a mark like '@' stands for a white > rather than transparent space. Done sprite-wise you could have > say a dog and cat which appear randomly at different speeds and > pass each other different each time; which of course is not possible > simply using a very large number of fixed frames. Different speeds > perhaps by having sprites move per 1, 2, 3... basic ticks > independent of each other. > > Here is ANIMX.CPP, mime enclosure because it is over 70 chars long. > ################################################################## > [ Section: 1/1 File: animx.cpp Encoder: Turnpike Version 3.03a ] > > Name: animx.cpp > Part 1.2 Type: unspecified type (application/octet-stream) > Encoding: x-uuencode > > sum -r/size 41627/35826 section (from "begin" to "end") > sum -r/size 9668/25981 entire input file . ___ ???/\ _/ |===%^, |_____| \/> --- == > [_____] __>,^ ejm97 | | //| | Rats. I can't seem to view a .cpp. (not familiar with that extension) Maybe you could put it on the www and post the URL? ~, \_,^^%--- /)\~__> \ In the meantime, ' \ \~_>^_ ~ I have made another _\ )_\_( )~~~ attempt at the gallop. | |/_ _!/ ejm98 / It can be viewed at http://www.geocities.com/SoHo/Studios/9334/horsgallp8.htm NOTE: If you hit the reply button, add an "e" to the "freent"; its absense is to stop the torment of automatic mailers. -- ~, \_,^^%--- www.geocities.com/SoHo/Studios/9334/ /)\~__> \ Now cq5...@freenet.toronto.on.ca ' \ \~_>^_ ~ that I finally llizard aka ejm _\ )_\_( )~~~ understand your scripting, | |/_ _!/ I will do another one making ejm98 / it go across the window....
llizard wrote in message <34D...@freent.toronto.on.ca>... > ___ ???/\ > _/ |===%^, > |_____| \/> > --- == > > [_____] __>,^ >ejm97 | | //| | > >Rats. I can't seem to view a .cpp. (not familiar with that extension) >Maybe you could put it on the www and post the URL? It's a C++ file (.c plus plus). Probably text source, but I'm not too sure. >>BKNambo -- http://come.to/brocks.place | World Domination Through Trivia! "Lemming is the eternal force of life." --from the online weeding of Dee-Bee and Br_Lee_Luuuuuurve
In article <34D...@freent.toronto.on.ca>, llizard <cq5...@freent.toronto.on.ca> writes > >Rats. I can't seem to view a .cpp. (not familiar with that extension) >Maybe you could put it on the www and post the URL? Will do soon; .CPP is C++ prgramming language (bit like Java/JScipt) i.e. just a plain ascii text file albeit longer than 70 columns in places. |~/ |~/ ~~|;'^';-._.-;'^';-._.-;'^';-._.-;'^';-._.-;||';-._.-;'^';||_.-;'^'0-|~~ P | Woof Woof, Glug Glug ||____________|| 0 | P O | Who Drowned the Judge's Dog? | . . . . . . . '----. 0 | O O | answers on *---|_______________ @__o0 | O L |{a href="news:alt.religion.scientology"}{/a}_____________|/_______| L and{a href="http://www.xemu.demon.co.uk/clam/lynx/q0.html"}{/a}XemuSP4(:)
Related ASCII art in the Gallery
Explore these categories from our collection of 11,000+ artworks:
Make your own ASCII art
Turn images, text or 3D into ASCII, or draw your own – right in your browser.
About this thread.
These messages were posted publicly to the newsgroup
alt.ascii-art
in 1998 and are mirrored here unchanged as part of the Historic Archives – only email addresses are masked.
The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can.
Are you one of the authors? Contact us to get your posts attributed, connected to your artist profile, or removed.
Report this message
Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.