Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import: iT4NKZfx;
- #import: AAMw1hB3;
- getClosestPosInCuboid(pos, start, end): {
- return([numInRange(pos[0], start[0], end[0]),
- numInRange(pos[1], start[1], end[1]),
- numInRange(pos[2], start[2], end[2])]);
- };
- numInRange(num, _min, _max):{
- return(max(_min, min(num, _max)));
- };
- main: {
- print("links: Fuel");
- print("rechts: Zeugs");
- x1,y1,z1=splitText(input("start<x,y,z>"),",");
- x2,y2,z2=splitText(input("end<x,y,z>"),",");
- x1,x2 = minMax(tonumber(x1),tonumber(x2));
- y1,y2 = minMax(tonumber(y1),tonumber(y2));
- z1,z2 = minMax(tonumber(z1),tonumber(z2));
- start = [x1,y1,z1];
- end = [x2,y2,z2];
- print("start: "+start);
- print("end: "+end);
- pos = locate();
- closestPos = getClosestPosInCuboid(pos, start, end);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement