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 » Scripting Helpers
Home Search
 

Re: Who can make the shortest code

Previous Thread :: Next Thread 
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
29 Mar 2014 06:14 PM
I will now write a code, making it EXTREMELY long. Shortest improvement wins!

Values = {"Just to mess it up a little..."}

while true do
AAA = math.random(math.random(5, 20), math.random(6, 22))
BBB = math.random(math.random(5, 20), math.random(6, 22))

AA = math.random(AAA, AAA * 2)
repeat
BB = math.random(BBB, BBB * 2)
until BB > AA

A = math.random(AA, BB)
B = math.random(AA, BB)

table.insert(Values, AAA)
table.insert(Values, BBB)
table.insert(Values, AA)
table.insert(Values, BB)
table.insert(Values, A)
table.insert(Values, B)


for I = 1,#Values do
Ammount = 0
repeat
Ammount = Ammount + 1
print(Values[I])
print(Values[I])
print(Values[I])
print(Values[I])
print(Values[I])
until Ammount == 5
end

for I = 1,#Values do
print(Values)
table.remove(Values, I)
print(Values)
end
end




Bonus points if you make it a one liner!!!
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
29 Mar 2014 06:36 PM
Well I figured someone would know...
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
29 Mar 2014 06:38 PM
I don't know what it is supposed to do.
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
29 Mar 2014 06:40 PM
and you could easily make this a one liner. i.e

while true do
local p = Instance.new('Part', Workspace)
wait()
end

is the same as

while true do local p = Instance.new('Part', Workspace) wait() end

#nerdsunited
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
29 Mar 2014 06:41 PM
@verified that has nothing to do with my question.



Also, 2 posts above, plug the script in studio and find out
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
29 Mar 2014 06:42 PM
"Bonus points if you make it a one liner!!!"

uwotm8

#nerdsunited
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
29 Mar 2014 06:42 PM
V = {}
repeat
a = math.random(6,777)
b = math.random(6,50)
table.insert(V,b)
table.insert(V,a)
until a-b<100
for I,v in pairs(V) do
print (I,v)
end

I have no idea what ur doing,but is this the idea??
Report Abuse
Duelingwarlord is not online. Duelingwarlord
Joined: 15 Feb 2010
Total Posts: 22333
29 Mar 2014 06:44 PM
the purpose of this is unclear.
Report Abuse
Rethiux is not online. Rethiux
Joined: 14 Nov 2012
Total Posts: 1132
29 Mar 2014 06:46 PM
game.Workspace:ClearAllChildren()


(You asked for the shortest script, not related to yours.)

-Stravus Police Department- (C) Commissioner :: Join today!
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
29 Mar 2014 06:48 PM
Values = {"Just to mess it up a little..."} while true do AAA = math.random(math.random(5, 20), math.random(6, 22)) BBB = math.random(math.random(5, 20), math.random(6, 22)) AA = math.random(AAA, AAA * 2) repeat BB = math.random(BBB, BBB * 2) until BB > AA A = math.random(AA, BB) B = math.random(AA, BB) table.insert(Values, AAA) table.insert(Values, BBB) table.insert(Values, AA) table.insert(Values, BB) table.insert(Values, A) table.insert(Values, B) for I = 1,#Values do Ammount = 0 repeat Ammount = Ammount + 1 print(Values[I]) print(Values[I]) print(Values[I]) print(Values[I]) print(Values[I]) until Ammount == 5 end for I = 1,#Values do print(Values) table.remove(Values, I) print(Values) end end

there, that is a one liner.

#nerdsunited
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
29 Mar 2014 06:49 PM
*kinda restarts*

How bout a .Chatted function?I'm sure we ALL like those..

Ill make a REALLY long one,and whoever makes shortest..

Well,yknow

DesiredMsg = "hello world!"
function MsgSent(Message,p)
msg = Message:lower()
if msg == DesiredMsg then
Msg = Instance.new("Message")
Msg.Parent = Workspace
Name = p.Name
Mess = msg
Msg.Text = (""..Name..":"..Mess.."")
end
end

function PlayerJoined(plr)
plr.Chatted:connect(function(msg)
MsgSent(msg,plr)
end)
end

game.Players.ChildAdded:connect(PlayerJoined)

Its easy to simplify,but,currently long
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
29 Mar 2014 06:49 PM
@island

If your script accomplishes EXACTLY what mine does, then you win. Lol



The purpose is to shorten my ridiculously long simple script.


It is a simple script, but I overcomplicated it by making it long.
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
29 Mar 2014 06:50 PM
i get bonus points, mine was a one liner.

#nerdsunited
Report Abuse
GOLDC3PO is not online. GOLDC3PO
Joined: 31 May 2011
Total Posts: 509
29 Mar 2014 06:52 PM
repeat until #Values > 5
table.insert(math.random(1,9),Values)
end
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
29 Mar 2014 06:53 PM
@gold,
attempted to call a nil value (Values)

#nerdsunited
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
29 Mar 2014 06:57 PM
@island


*kinda restarts*

How bout a .Chatted function?I'm sure we ALL like those..

Ill make a REALLY long one,and whoever makes shortest..

Well,yknow

D="hello world!"
game.Players.ChildAdded:connect(function(p)
p.Chatted:connect(function(M)
M=M:lower()
if M==D then
Msg=Instance.new("Message",Workspace)
Msg.Text=""..p.Name..": "..M..""--You also forgot a space THIS COMNENT DON'T COUNT
end
end)
end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
29 Mar 2014 07:00 PM
Beat this:

game.Players.PlayerAdded:connect(function(p)
p.Chatted:connect(function(m)
if m:lower() == "hello world!" then Instance.new("Message",Workspace).Text = (p.Name..":"..m)
end) end)
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
29 Mar 2014 07:01 PM
Btw@your comment

Spaces don't matter,but the parenthisis does the "("s

If they aren't there..

print "hi".."hello".."by"

Error,cuz no "("s
Report Abuse
VerifiedName is not online. VerifiedName
Joined: 26 Jul 2009
Total Posts: 4534
29 Mar 2014 07:01 PM
@island, you're missing an end

#nerdsunited
Report Abuse
jode6543 is not online. jode6543
Joined: 16 Jun 2009
Total Posts: 5363
29 Mar 2014 07:01 PM
There's a good chance your original script will error. If the second parameter to math.random happens to smaller than the first (which it could be, since your passing the return of another math.random into it), then the script will error.

~Jode
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
29 Mar 2014 07:03 PM
If that is what you want.

game.Players.ChildAdded:connect(function(p)
p.Chatted:connect(function(m)
if m:lower()=="hello world!" then Instance.new("Message",Workspace).Text=p.Name..": "..m end
end) end)


You forgot an end by the way
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
29 Mar 2014 07:04 PM
@ver
Thx for pointin that out

But,my script (even with the end) is still shortest

I win,on my own post :p
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
29 Mar 2014 07:05 PM
@war
By changing that to .ChildAdded

It might error if something else inserts into game.Players but..

You win(I think) by like 2 characters
Report Abuse
islandmaker2012 is not online. islandmaker2012
Joined: 07 Nov 2012
Total Posts: 9327
29 Mar 2014 07:11 PM
Me(factoring in the missed end):
181 characters
war:
177 characters

He won,but mine won't ever error
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
29 Mar 2014 07:13 PM
wrong forum
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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