Aw comon, doesn't anyone think this is a good idea.
I want to be able to use a variable to make new variables using the same kind of system as concommand('$H$:$M$:$S$') does. I am making a number sorter for an "infinite floor elevator" Heres my current code which is supposed to be used with a target finder and may or may not work.
My new code if this feature were added would be something like "~A -> A$A$ = Max;"
Code:N@Number Sorter I@In O@Next A1 A2 A3 A4 A5 interval(20) ((In > Min) & (In < Max)) | (Min >= Max) | A -> Max = In; (Next = !Next * (A < 5)) & ~Next -> N += 1; N > 30 -> A += 1; (A == 1) & ~A -> A1 = Max; (A == 2) & ~A -> A2 = Max; (A == 3) & ~A -> A3 = Max; (A == 4) & ~A -> A4 = Max; (A == 5) & ~A -> A5 = Max;
(\__/) Expression 2 Resources: E2 Beginner's Guide | E2 Formatting Guide | E2 Function Reference | E2 Examples | Me
(='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
(")_(") Drunkie referring to an E2: "It's obvious that Chinoto made this, his coding style is all over it."
Aw comon, doesn't anyone think this is a good idea.
(\__/) Expression 2 Resources: E2 Beginner's Guide | E2 Formatting Guide | E2 Function Reference | E2 Examples | Me
(='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
(")_(") Drunkie referring to an E2: "It's obvious that Chinoto made this, his coding style is all over it."
In normal cases all floors are of the same height, and there is a slight offset from the ground and/or top... Why in hell you need to have elevator height in all the floors if you can count it via (FloorHeight*DesiredFloor)+Offset ??? That way you'd get really infinite (well virtually infinite, you're still bound to number and other limitations) elevator with less headache...
2d head with 3d brains
I dont know why I even made that expression, but this one I made shortly after would benefit from variable numbering because it would be able to have as many coordinates as a person wants (is there a limit to variables and do vectors have any problems like packets do?).
Code:N@Multi-Coordinate Teleporter I@Xi Yi Zi Prev Next Set Go Act O@Xo Yo Zo Cs Jump Cd interval(100) Cs += (Prev & ~Prev) - (Next & ~Next) Cs > 10 -> Cs = 1; Cs < 1 -> Cs = 10; (Cs == 1) & Set -> V1 = vector(Xi, Yi, Zi); (Cs == 2) & Set -> V2 = vector(Xi, Yi, Zi); (Cs == 3) & Set -> V3 = vector(Xi, Yi, Zi); (Cs == 4) & Set -> V4 = vector(Xi, Yi, Zi); (Cs == 5) & Set -> V5 = vector(Xi, Yi, Zi); (Cs == 6) & Set -> V6 = vector(Xi, Yi, Zi); (Cs == 7) & Set -> V7 = vector(Xi, Yi, Zi); (Cs == 8) & Set -> V8 = vector(Xi, Yi, Zi); (Cs == 9) & Set -> V9 = vector(Xi, Yi, Zi); (Cs == 10) & Set -> V10 = vector(Xi, Yi, Zi); Cs == 1 -> Xo = vecx(V1), Yo = vecy(V1), Zo = vecz(V1); Cs == 2 -> Xo = vecx(V2), Yo = vecy(V2), Zo = vecz(V2); Cs == 3 -> Xo = vecx(V3), Yo = vecy(V3), Zo = vecz(V3); Cs == 4 -> Xo = vecx(V4), Yo = vecy(V4), Zo = vecz(V4); Cs == 5 -> Xo = vecx(V5), Yo = vecy(V5), Zo = vecz(V5); Cs == 6 -> Xo = vecx(V6), Yo = vecy(V6), Zo = vecz(V6); Cs == 7 -> Xo = vecx(V7), Yo = vecy(V7), Zo = vecz(V7); Cs == 8 -> Xo = vecx(V8), Yo = vecy(V8), Zo = vecz(V8); Cs == 9 -> Xo = vecx(V9), Yo = vecy(V9), Zo = vecz(V9); Cs == 10 -> Xo = vecx(V10), Yo = vecy(V10), Zo = vecz(V10); first() | (Cd <= -1) -> Cd = 5, I = 0; Go -> Cd = 5, I = -0.1; Cd += I Jump = (Cd <= 0) & Act
(\__/) Expression 2 Resources: E2 Beginner's Guide | E2 Formatting Guide | E2 Function Reference | E2 Examples | Me
(='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
(")_(") Drunkie referring to an E2: "It's obvious that Chinoto made this, his coding style is all over it."
Why not just use memory chip with floor number as address? Seriously, don't get things more complicated than they are in reality![]()
2d head with 3d brains
Did I say this one was for an elevator, no. It is for storing any coordinates, then being able to retrieve them for use with a hoverdrive.
Last edited by chinoto; 09-24-2008 at 10:24 AM.
(\__/) Expression 2 Resources: E2 Beginner's Guide | E2 Formatting Guide | E2 Function Reference | E2 Examples | Me
(='.'=) PM me code and I'll send it back optimized if possible. (I find it fun dammit!)
(")_(") Drunkie referring to an E2: "It's obvious that Chinoto made this, his coding style is all over it."
That made it quit seem you did. I didn't knew you switched projects neither.
But anyways, 3dfactor has a point.
Adress
0 indexnumber
1 x
2 y
3 z
4 indexnumber
5 x
6 y
7 z
8 indexnumber
9 x
10 y
11 z
etc.
Increment index by 4 and retrieve X Y Z from there. With 3 seperate RAM you don't even need to loop through data.
Or am I totally wrong here?
Uh, the GPS can save and retrieve coordinates for you. But if you want to store it in RAM, do it like l3ulletje said, but you don't need an index number. Just multiply it by 3 and subtract two, ie. 1 => 1, 2 => 4 etc., and then loop through them. Actually, looping in the expression gate is a pain -- use E2 or the CPU.
True Azreal. Indexnumbers would only make it more complicated. The place of the data on the RAM is already an index.
I was thinking too diffiult. My thought was if you want to retrieved saved position 33, you would go to indexnumber 33.
But just retrieve data from 99, 100, 101 would be enough![]()
Bookmarks