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: Javascript, PHP and Lua

Previous Thread :: Next Thread 
Digitalizing is not online. Digitalizing
Joined: 13 Aug 2013
Total Posts: 1057
23 Dec 2013 10:17 AM
$age = 17;

if ($age > 16) {
echo "You can drive!";
}

var age = 17;

if (age > 16) {
HORROR STORIES >> document.write "You can drive!";
}

age = 17;


if age > 16 then
print ("You can drive!");
end

I'm noticing a pattern.
Report Abuse
UltraReborn is not online. UltraReborn
Joined: 17 Feb 2012
Total Posts: 573
23 Dec 2013 10:22 AM
I know a bit of JavaScript, use to know Lua, but I am more better in Objective C.

In Objective C it would go like this
int age = 17

if (age > 16) {
NSLog(@"You can drive");
}

This may compile with error cause I sorta just ate and I am like sleepy, but you know lots of languages you can see patterns.
Report Abuse
nukeysaurusrex is not online. nukeysaurusrex
Joined: 24 Oct 2013
Total Posts: 2451
23 Dec 2013 10:25 AM
@Ultra, be my Obj-C friend.
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
23 Dec 2013 10:40 AM
Why the semicolons in Lua?
print("no semicolons here kk")
Report Abuse
Digitalizing is not online. Digitalizing
Joined: 13 Aug 2013
Total Posts: 1057
23 Dec 2013 10:41 AM
Just a habit.
Report Abuse
OneTrueGodTheHolyCow is not online. OneTrueGodTheHolyCow
Joined: 24 Oct 2013
Total Posts: 9350
23 Dec 2013 11:06 AM
Age := 17
if Age <= 16 {
fmt.Println("You can't drive! Are you crazy?")
}
Report Abuse
branefreez is not online. branefreez
Joined: 29 Dec 2011
Total Posts: 321
23 Dec 2013 11:31 AM
@Mettasaur, I use semicolons so there isn't and ambiguity in my code:
----
Ex:

print("HI!")

(Something else here that isn't a statement or assignment)
----
,results in ambiguity. The parser thinks that you are trying to do:
print("Hi!")(Something Else Here); [passing arguments to a returned function {like in RBXUtil's Create''{} function}]

Instead, if you used semi-colons:
----
print("Hi!");

(Something else here);
----
,it wouldn't error because it now knows that they are both separate statements unto themselves.

Everybody is happy now!!!
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
23 Dec 2013 11:41 AM
I just tried putting a semicolon between a print call and a line that wasn't a statement or assignment and it still errored "attempt to call nil value". I don't think semi colons do much really other than split up statements surefire and make the code look ugly with out of place semicolons.
Report Abuse
branefreez is not online. branefreez
Joined: 29 Dec 2011
Total Posts: 321
23 Dec 2013 11:43 AM
I'm going to quote Oysi here:

"""
You have to use semicolons right there, because Lua didn't know what to do, and just called it ambiguous syntax.

Look, when you try to call a function like this:

f
()

it says ambiguous syntax. Which is what Lua thought you MIGHT want to do.
Look:

(function()
print("Test0")
end)()(function()
print("Test1")
end)()

I just removed those enters, and it turned like that. A tailcall, if you will.
Which is fully possible, and you could make it return functions to not error.

Notice how there are two possible inputs. One where you call two anonymous functions, and the other where you tailcall. Lua can't know which one to choose, because lua doesn't want to be wrong. Therefore lua just calls it ambiguous syntax, and makes you add those semicolons.
"""
From this thread: http://www.roblox.com/Forum/ShowPost.aspx?PostID=48670685
Report Abuse
MettaurSp is not online. MettaurSp
Joined: 20 Mar 2010
Total Posts: 3179
23 Dec 2013 11:53 AM
I stated that I know it forces a new statement, so I know why that is happening, but I don't get why exactly one would even need to put two tail calls in the first place when what is done in both can be done in just one. Also, semicolons still look out of place in Lua when used frivolously.
Report Abuse
AbsoluteLOL is not online. AbsoluteLOL
Joined: 01 Dec 2012
Total Posts: 3939
23 Dec 2013 12:01 PM
Now, make it in Assembly.
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
23 Dec 2013 12:02 PM
+++++ +++++
[
> +++++ ++
> +++++ +++++
> +++
> +
<<<< -
]
> ++ .
> + .
+++++ ++ .
.
+++ .
> ++ .
<< +++++ +++++ +++++ .
> .
+++ .
----- - .
----- --- .
> + .
> .
Report Abuse
branefreez is not online. branefreez
Joined: 29 Dec 2011
Total Posts: 321
23 Dec 2013 12:11 PM
Is that Brainfck?

It sure looks like it. I've always wonted to learn how to program in it.
Report Abuse
digpoe is not online. digpoe
Joined: 02 Nov 2008
Total Posts: 9092
23 Dec 2013 01:11 PM
yes it is

Don't ask me how I know what it does.

It prints 'Hello world\n' (where \n is actually the \n character)
Report Abuse
branefreez is not online. branefreez
Joined: 29 Dec 2011
Total Posts: 321
23 Dec 2013 01:16 PM
It's basically the same as assembly, but it just adds or removes a bit from the stack, or shuffles it around. It is a very minimalist approach towards ASM. [It MIGHT be useful if they have a very limited amount of keys on their keyboard].
Report Abuse
chickenman158 is not online. chickenman158
Joined: 18 Jan 2011
Total Posts: 915
23 Dec 2013 05:14 PM
That isn't what assembly does. In fact, it is not even basically the same as assembl(y|er).

Brain_ is just an annoying way to give instructions to a computer, it is minimalist, but inefficient. Subleq-based code would be more efficient, and take less time to program in.
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