Jump to content
  • 0

How to ake my code short


ZTzTopiaa

Question

code1 = 1
code2 = 2
code3 = 3
code4 = 4
code5 = 5
code6 = 6
code1 = co6
code2 = cop7
code3 = c8
code4 = co8
code5 = cod8
code6 = co109
wrong xd
Spoiler
Spoiler
Spoiler

 

 

 

ignore code1 = co6, code2 = cop7 i cant delete heheh

How to make code1 - 6 short?

 

WTF

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Use tables and loops.

For example, creating array-like table with 6 elements where values are equal to keys:

local t = {}
for i = 1, 6 do
  t[i] = i
end

Then you can access it's elements by their key, like this:

print(t[4]) -- prints "4"
Link to comment
Share on other sites

10 hours ago, CmP said:

Use tables and loops.

For example, creating array-like table with 6 elements where values are equal to keys:


local t = {}
for i = 1, 6 do
  t[i] = i
end

Then you can access it's elements by their key, like this:


print(t[4]) -- prints "4"

THX YOU

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.