generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: ###### 2.0

Previous Thread :: Next Thread 
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
13 Apr 2017 03:27 PM
Thought I'd make a thread regarding this, full credit to Tynezz for the idea.

The task:

You must write a program that outputs every single number that is a multiple of 3 or 5 in under a minute up to 4,000,000 in Studio.

I've just started trying stuff, I've got 1m 35s

No hardcoded solutions!

Good luck!


Report Abuse
NilLogic is not online. NilLogic
Joined: 08 Apr 2016
Total Posts: 1369
13 Apr 2017 03:27 PM
*watchinh movie* *completely occupied*.
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
13 Apr 2017 03:28 PM
not another bot ;(


Report Abuse
10MilesWide is not online. 10MilesWide
Joined: 06 Aug 2014
Total Posts: 2220
13 Apr 2017 04:11 PM
Iterations: 4000000
Time elapsed: 38.040461540222
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
13 Apr 2017 04:13 PM
and you outputted every number? ;(


Report Abuse
Nitro509 is not online. Nitro509
Joined: 27 Jun 2010
Total Posts: 11170
13 Apr 2017 04:13 PM
I'm not good at things that require performance increases. But I am running a lot of programs right now so it might be slowing RBLX studio.


Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
13 Apr 2017 04:16 PM
Ahh, that might have affected my time :P I have Finder, Chrome, Mail, Notes, Messages, Studio, a social media that gets filtered, Discord and Spotify open all on a 2011 MacBook Pro


Report Abuse
Nitro509 is not online. Nitro509
Joined: 27 Jun 2010
Total Posts: 11170
13 Apr 2017 04:17 PM
Then you're program is definitely better than mine.
-- Nitro509

for i=1,4000000 do

if i % 3 == 0 then print(i) end

if i % 5 == 0 then print(i) end

end


Report Abuse
hasang1 is not online. hasang1
Joined: 09 Nov 2012
Total Posts: 903
13 Apr 2017 04:18 PM
print("every single number that is a multiple of 3 or 5 in under a minute up to 4,000,000 in Studio.")
I WIN


"HOME SWEET HOME" -my PC
Report Abuse
10MilesWide is not online. 10MilesWide
Joined: 06 Aug 2014
Total Posts: 2220
13 Apr 2017 04:20 PM
Yes. Not going to run 4m iterations again but here's some from 400k
8945,398946,398949,398950,398952,398955,398958,398960,398961,398964,398965,398967,398970,398973,398975,398976,398979,398980,398982,398985,398988,398990,398991,398994,398995,398997,399000,399003,399005,399006,399009,399010,399012,399015,399018,399020,399021,399024,399025,399027,399030,399033,399035,399036,399039,399040,399042,399045,399048,399050,399051,399054,399055,399057,399060,399063,399065,399066,399069,399070,399072,399075,399078,399080,399081,399084,399085,399087,399090,399093,399095,399096,399099,399100,399102,399105,399108,399110,399111,399114,399115,399117,399120,399123,399125,399126,399129,399130,399132,399135,399138,399140,399141,399144,399145,399147,399150,399153,399155,399156,399159,399160,399162,399165,399168,399170,399171,399174,399175,399177,399180,399183,399185,399186,399189,399190,399192,399195,399198,399200,399201,399204,399205,399207,399210,399213,399215,399216,399219,399220,399222,399225,399228,399230,399231,399234,399235,399237,399240,399243,399245,399246,399249,399250,399252,399255,399258,399260,399261,399264,399265,399267,399270,399273,399275,399276,399279,399280,399282,399285,399288,399290,399291,399294,399295,399297,399300,399303,399305,399306,399309,399310,399312,399315,399318,399320,399321,399324,399325,399327,399330,399333,399335,399336,399339,399340,399342,399345,399348,399350,399351,399354,399355,399357,399360,399363,399365,399366,399369,399370,399372,399375,399378,399380,399381,399384,399385,399387,399390,399393,399395,399396,399399,399400,399402,399405,399408,399410,399411,399414,399415,399417,399420,399423,399425,399426,399429,399430,399432,399435,399438,399440,399441,399444,399445,399447,399450,399453,399455,399456,399459,399460,399462,399465,399468,399470,399471,399474,399475,399477,399480,399483,399485,399486,399489,399490,399492,399495,399498,399500,399501,399504,399505,399507,399510,399513,399515,399516,399519,399520,399522,399525,399528,399530,399531,399534,399535,399537,399540,399543,399545,399546,399549,399550,399552,399555,399558,399560,399561,399564,399565,399567,399570,399573,399575,399576,399579,399580,399582,399585,399588,399590,399591,399594,399595,399597,399600,399603,399605,399606,399609,399610,399612,399615,399618,399620,399621,399624,399625,399627,399630,399633,399635,399636,399639,399640,399642,399645,399648,399650,399651,399654,399655,399657,399660,399663,399665,399666,399669,399670,399672,399675,399678,399680,399681,399684,399685,399687,399690,399693,399695,399696,399699,399700,399702,399705,399708,399710,399711,399714,399715,399717,399720,399723,399725,399726,399729,399730,399732,399735,399738,399740,399741,399744,399745,399747,399750,399753,399755,399756,399759,399760,399762,399765,399768,399770,399771,399774,399775,399777,399780,399783,399785,399786,399789,399790,399792,399795,399798,399800,399801,399804,399805,399807,399810,399813,399815,399816,399819,399820,399822,399825,399828,399830,399831,399834,399835,399837,399840,399843,399845,399846,399849,399850,399852,399855,399858,399860,399861,399864,399865,399867,399870,399873,399875,399876,399879,399880,399882,399885,399888,399890,399891,399894,399895,399897,399900,399903,399905,399906,399909,399910,399912,399915,399918,399920,399921,399924,399925,399927,399930,399933,399935,399936,399939,399940,399942,399945,399948,399950,399951,399954,399955,399957,399960,399963,399965,399966,399969,399970,399972,399975,399978,399980,399981,399984,399985,399987,399990,399993,399995,399996,399999,400000


I wonder how much of a difference the CPU makes
Report Abuse
GNUnotUNIX is not online. GNUnotUNIX
Joined: 05 Feb 2012
Total Posts: 15171
13 Apr 2017 04:21 PM
for i=1,400 do
for x=i*(i-1)+1,10000*i do
if x%3==0 or x%5==0 then
print(x)
end
end
wait(.01)
end


Report Abuse
GNUnotUNIX is not online. GNUnotUNIX
Joined: 05 Feb 2012
Total Posts: 15171
13 Apr 2017 04:21 PM
oops


for i=1,400 do
for x=i*(i-1)+1,10000*i do
if x%3==0 or x%5==0 then
print(x)
end
end
wait(.1)
end


Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
13 Apr 2017 04:22 PM
Can you show your code please, 10Miles? I've been trying to do this but I guess the processor on this computer is having difficulty, I haven't been able to get it under ten minutes. If I could compare off of your code I might be able to see if my computer has an issue or if my CPU is just not what it's cracked up to be.


Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
13 Apr 2017 04:23 PM
Ooo I remember somebody saying that wait(0) is very slightly shorter than wait() let me try my method with that


Report Abuse
GNUnotUNIX is not online. GNUnotUNIX
Joined: 05 Feb 2012
Total Posts: 15171
13 Apr 2017 04:23 PM
wait no it won't work 1 sec


Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
13 Apr 2017 04:23 PM
I have a 2.4GHz Intel Core i5 Processor, it's not exactly anything special :P


Report Abuse
hasang1 is not online. hasang1
Joined: 09 Nov 2012
Total Posts: 903
13 Apr 2017 04:23 PM
Please, Josh
game:GetService'RunService'.Stepped:wait(0)



"HOME SWEET HOME" -my PC
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
13 Apr 2017 04:25 PM
I'm guessing that doesn't work in the command bar though


Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
13 Apr 2017 04:25 PM
"I remember somebody saying that wait(0) is very slightly shorter than wait()"
He's completely wrong.

coroutine.yield() IS shorter though, at about 1/60.


Report Abuse
hasang1 is not online. hasang1
Joined: 09 Nov 2012
Total Posts: 903
13 Apr 2017 04:25 PM
Here's some actual code
local SelectYourDestiny=10000 --Change if you think you can.
for i=1,4000000 do
if (i%3==0) or (i%5==0) then
print(i)
end
if i%SelectYourDestiny==0 then
game:GetService'RunService'.Stepped:wait(0)
end
end


"HOME SWEET HOME" -my PC
Report Abuse
hasang1 is not online. hasang1
Joined: 09 Nov 2012
Total Posts: 903
13 Apr 2017 04:26 PM
@Jarod
I'm pretty sure yeah, it is shorter.
And wait() is variable in studio due to a setting
wait(0) is not.


"HOME SWEET HOME" -my PC
Report Abuse
JoshRBX is not online. JoshRBX
Joined: 19 May 2012
Total Posts: 8778
13 Apr 2017 04:26 PM
@has

That takes like 3 mins to run for me
I've found that 10k is way too high


Report Abuse
hasang1 is not online. hasang1
Joined: 09 Nov 2012
Total Posts: 903
13 Apr 2017 04:27 PM
@Josh
Therefore the variable being SelectYourDestiny (orwhatever)
I could make one to adjust to your max. iterations before starting to hang, but whatever.


"HOME SWEET HOME" -my PC
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
13 Apr 2017 04:28 PM
To the person saying that `wait(0)` is shorter, you have no idea what you're talking about.


Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
13 Apr 2017 04:29 PM
And if you wanted to be efficient, you wouldn't index the Stepped event each iteration. You would have a reference to it.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image