|
| 10 Nov 2012 10:43 PM |
| I know it's a percent sign, but i've seen it in some scripts that have countdowns and others that display a value, usually a string, and im not sure what it's purpose is. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 10:44 PM |
http://wiki.roblox.com/index.php/String_patterns#Character_Classes
I can't explain since there are like my only weakness.
deathCast(); |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 10 Nov 2012 10:45 PM |
| It's used to indicate a string pattern. |
|
|
| Report Abuse |
|
|
1waffle1
|
  |
| Joined: 16 Oct 2007 |
| Total Posts: 16381 |
|
|
| 10 Nov 2012 10:47 PM |
x = "a1b2c3d" y = "" for z in x:gmatch("[%D]+") do y=y..z end print(y)
> abcd |
|
|
| Report Abuse |
|
|
| |
|
|
| 10 Nov 2012 10:59 PM |
You can also use it to returnt he remainder of a division operation (modulus):
print( 3 % 2 ) --> 1 |
|
|
| Report Abuse |
|
|
| |
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 10 Nov 2012 11:37 PM |
| % allows you to also use "magic" characters such as %,*,[,],(,),.,+,-,?,etc in your pattern. |
|
|
| Report Abuse |
|
|
|
| 10 Nov 2012 11:38 PM |
| @Captain, I think it's implying division, and 2 goes into 3 once, so there is 1 leftover. |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 10 Nov 2012 11:43 PM |
@Captain
The modulus of a number is basically this:
17%3 is the same as (math.floor(17/3)*5)+2 17/3 = 5 (math.floor(17/3)*5)+2 = 17 |
|
|
| Report Abuse |
|
|
Riderj
|
  |
| Joined: 15 Aug 2011 |
| Total Posts: 1534 |
|
|
| 10 Nov 2012 11:45 PM |
Ignore that rofl, tired not thinking straight.
17/3 = 5 (5*3)+2 = 17
5 comes from 17%3 |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 12:03 AM |
Ever do Long Division? '%' basically gives you the 'r' or remainder value.
12%5 = 2, because 5 goes into 12 only up to 10 fully, with a remainder of 2. |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 12:09 AM |
-Feels stupid-
I understand nothing about what Crazyman32 just said... |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 12:11 AM |
Oh wait like this? (Not sure how this will turn out after I press post, Hope for the best)
2 R2 ___ 5|12 -10 ---- 2 |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Nov 2012 12:13 AM |
That looks nothing like how it looked before I pressed post xP Ima try and fix it while I post this
.....2 R2 ..___ 5|12 ..-10 ...---- ......2
I used dots because my spaces got removed |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 12:16 AM |
2 R2 .------ 5 | 1 2 - 1 0 ------ 2
:D ? |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 12:22 AM |
------ 5| 12 -10 ------- R2
:D?
¤¤ †KMXD† ¤¤
|
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 12:23 AM |
Show off -.-
Jk xD
How did you make it not auto remove your spaces? |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 12:23 AM |
| That's not how I learned my long division. >:o |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Nov 2012 12:25 AM |
| I learned mine how you typed it :P |
|
|
| Report Abuse |
|
|
|
| 11 Nov 2012 12:26 AM |
(Presses alt+0160)
(Gets nothing) |
|
|
| Report Abuse |
|
|
SN0X
|
  |
| Joined: 24 Oct 2011 |
| Total Posts: 7277 |
|
|
| 11 Nov 2012 01:13 AM |
You need a numpad ...
To use regular numbers you press alt+fn+ctrl+n+p+numpad+0160
Yeah that's a lot of buttons...just copy and paste |
|
|
| Report Abuse |
|
|
| |
|