M4LLARDJoin Date: 2012-08-13 Post Count: 3201 |
Being a big VSauce fan I am always bewildered by the information that Michael, Kevin and Jake bring me, and I began to wonder, what if I could bring a SuperTask, onto Roblox.
Now it's clear why the idea is absolutely preposterous, and I was quite silly to think it would be possible, but I'd like to pass on what I've learnt, and explain some programming logic to the Scripters' Sub-Forum.
If you're wondering what a supertask is,
"a countably infinite sequence of operations that occur sequentially within a finite interval of time"
This is achieved by taking an amount of time (in my example I am using one minute) and performing an action within this amount of time. Then I halve the time, and the value of my action (in my case, dividing a number by two) and repeating, until it has been done infinitely.
But why will this not work in RobloxLua, or computing?
First of all, we just cannot build a computer strong enough to do this without crashing,
and this has been theorized, by "Davies' super-machine", but due to many sciencey reasons, this cannot be built.
Which brings me on to how this relates to programming, this is where I would link you to a Wikipedia article, but due to restrictions I cannot.
To make this simple, any computer is just a bunch of switches. These can be on, or off. And these switches are very, very small. You probably know this better as Binary, with all those 1s and 0s that you learnt about in school. When there become too many numbers, and not enough switches, the numbers start to get inaccurate, this causes something called "Stack Overflow", you've probably seen this in your output before. This is what happens when a program tries to use more memory than the call stack has to offer. This is when it gets messy. You keep demanding numbers and Lua can't take it. But instead of erroring, Roblox keeps its cool and continues to do this as fast as it can, until eventually the numbers get to ridiculously slow and inaccurate that the code will return 0.
I'm still in learning myself and I would love to learn more, if you'd like to contribute or teach something then please do.
This is my code below, try running it or editing it.
local TimeToComplete = 60
local Time = TimeToComplete/2
while true do
wait(Time)
print(Time)
Time = Time/2
end
~IanSplodge, Walrus God of the Forums. |
|
M4LLARDJoin Date: 2012-08-13 Post Count: 3201 |
After reviewing what I have written, I suppose this would be known as a Hypertask, not a Supertask, as the numbers I am working with would be unaccountably infinite, not countably infinite.
Why can't we just have one infinity?
~IanSplodge, Walrus God of the Forums. |
|
|
OMG i need to join the electro legion xD |
|
M4LLARDJoin Date: 2012-08-13 Post Count: 3201 |
EL are quite an old clan, we're been around since 2012, and have made a good impact on the clan world, we're coming back once again.
Good to see that the only comment on my post was about my clan x3
~IanSplodge, Walrus God of the Forums. |
|
|
M4LLARDJoin Date: 2012-08-13 Post Count: 3201 |
What do you think of the concept?
~IanSplodge, Walrus God of the Forums. |
|
|
so pretty much you're making a lag script for no purpose other than a concept?
I like how you think.
y-y-you too... |
|
MiniNobJoin Date: 2013-05-14 Post Count: 822 |
the print function, division by 2, and variable assignment also yield your script, but usually for a much shorter amount of time than the wait function. |
|
M4LLARDJoin Date: 2012-08-13 Post Count: 3201 |
I'm glad this has had such positive feedback, and I hope you have learnt something from this, I certainly have.
~IanSplodge, Walrus God of the Forums. |
|
M4LLARDJoin Date: 2012-08-13 Post Count: 3201 |
bumping it up again
~IanSplodge, Walrus God of the Forums. |
|
|
better lag script
function lag()
lag()
lag()
lag()
while wait() do
local p = Instance.new("Part", game.Workspace)
end
end
-____________________________- |
|
|
wait no that'd throw an error because functions being called to many times to fast
function lag()
wait()
lag()
lag()
lag()
while wait() do
local p = Instance.new("Part", game.Workspace)
end
end
there I fixed it
-____________________________- |
|
M4LLARDJoin Date: 2012-08-13 Post Count: 3201 |
That defeats the objective of this entire script.
~IanSplodge, Walrus God of the Forums. |
|
|
K
-____________________________- |
|
|
woah, I ran that script in studio, and it was quite interesting. |
|
|
...
So you know while true do end, will crash studio. This is trying to do an infinite amount of tasks over an infinite amount of time. Now, try and do an infinite amount of tasks IN A FINITE amount of time
|
|
M4LLARDJoin Date: 2012-08-13 Post Count: 3201 |
obviously you don't understand what this does.
It is attempting to do an infinite amount of actions in a finite amount of time, and I explain why that is not possible, and teach some programming along the way.
~IanSplodge, Walrus God of the Forums. |
|
|
I saw the title, posted angrily, then read it.
Typical Fourmer
|
|
|
I'll start by saying your understanding of a call stack isn't too far off. Your understanding of a stack overflow is also fairly accurate. Roblox, however, does not "keep its cool" and continue to run. Stack overflows are simply less common because stack management is done behind the scenes for the most part. Numbers do not become less accurate, they do not get stored at all.
This is not a supertask or a "hypertask". Dividing the number by 2 infinitely will never reach 0. If you had a computer capable of waiting fractions of picoseconds, this would never end.
-Ticker of da Tocks |
|
|
I'm the walrus god and cloud man, not you. |
|
|
lordramboJoin Date: 2009-06-16 Post Count: 20628 |
yeah I'm pretty sure boss is the walrus god around here
(the clouds are cause he lives in the sky) |
|
M4LLARDJoin Date: 2012-08-13 Post Count: 3201 |
I clearly said, this will not work.
I did not call it a hypertask.
I said how I tried to make a hypertask.
~IanSplodge, Walrus God of the Forums. |
|
|
M4LLARDJoin Date: 2012-08-13 Post Count: 3201 |
Honestly I'm trying to explain something out of my depth here. I'm helping the scripting community and learning myself, and that makes me better than all of you right now. So I get some things wrong. So you don't like my signature. So you think I'm unprofessional. Guess what.
I'm not changing for you.
~IanSplodge, Walrus God of the Forums. |
|