|
| 21 Apr 2015 10:22 PM |
int i = 0; for (;; ) { ++i; if ( i == 5 ) { continue; } Console.Write("oh god why {0} ", i); if ( i > 10 ) { break; } }
halp pls |
|
|
| Report Abuse |
|
|
222304
|
  |
 |
| Joined: 26 May 2008 |
| Total Posts: 24900 |
|
| |
|
|
| 21 Apr 2015 10:25 PM |
| that syntax looks cool (I'm only know rbx.lua) |
|
|
| Report Abuse |
|
|
| |
|
gerov
|
  |
| Joined: 05 Feb 2011 |
| Total Posts: 5504 |
|
|
| 21 Apr 2015 10:26 PM |
Your brackets annoy me.
But, that is just a personal thing. |
|
|
| Report Abuse |
|
|
|
| 21 Apr 2015 10:35 PM |
int i = 0; -- Invalid syntax. for (;; ) -- Invalid syntax. { -- Invalid syntax. ++i; --Invalid syntax. if ( i == 5 ) -- Strange, this is actually valid. { -- Invalid syntax. continue; -- Invalid syntax. } -- Invalid syntax. Console.Write("oh god why {0} ", i); -- Undeclared variable. if ( i > 10 ) -- Strangely valid. { -- Invalid syntax. break; -- Valid :\ } -- Invalid syntax. } -- Invalid syntax.
I can only assume that this is what you meant:
local int; i = 0; _for () -- Removed the use of a reserved keyword, and removed rogue semicolons. { -- This is now valid. i + i; -- I think this is what you meant. _if ( i == 5 ) -- Removed the use of a reserved keyword. { -- Now valid. continue; }; -- Added semicolon. Console.Write("oh god why {0} ", i); -- MAKE SURE you define Console! _if ( i > 10 ) -- Removed the use of a reserved keyword. -- MAKE SURE you change the variable names when they are declared too! { -- Now valid. _break; -- Removed the use of a reserved keyword. } } |
|
|
| Report Abuse |
|
|
222304
|
  |
 |
| Joined: 26 May 2008 |
| Total Posts: 24900 |
|
|
| 20 May 2015 06:18 PM |
| your first mistake is not conforming 2 roblox |
|
|
| Report Abuse |
|
|