A Roblox Community

A community of Robloxians who want to learn to script and build on Roblox Studio.
 
HomeFAQRegisterLog in
If you're a experienced coder make some tutorials! It would really help the site grow.
Make sure you read the rules(Which can be found by clicking here)
If you're a beginner at coding, try some tutorials.
We have many Moderators/Admins watching this site. Contact them with Questions.
Let us know what your favorite sport is. By clicking here to vote (Click here)
This site is becoming inactive. Lets make it active.
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Top posters
blueymaddog
 
naknak
 
Supernapalm
 
m27frogy
 
slayer9365
 
myrco919
 
branefreez
 
ninga95
 
CloneTrooper787
 
raboy117
 
Top posting users this month
Latest topics
» Send me an Email
January 8th 2016, 10:14 am by naknak

» [v1.6.0.0] Lua Script Obfuscator [No Bytecode]
July 6th 2015, 7:38 pm by m27frogy

» New Site Possibly
July 6th 2015, 4:16 pm by m27frogy

» Ambassador!
April 15th 2015, 11:40 pm by naknak

» Boop - Tag
April 13th 2015, 9:46 pm by naknak

» Vip Class Script
April 13th 2015, 4:54 pm by naknak

» Who's active?!
April 13th 2015, 4:52 pm by naknak

» Where to go from here.
April 13th 2015, 4:51 pm by naknak

» Genesis Point
July 17th 2014, 7:04 pm by branefreez

» Reward System
July 17th 2014, 5:41 am by m27frogy

» Script Request
July 10th 2014, 11:43 am by naknak

» local scripts?
July 10th 2014, 11:39 am by naknak

» Project: Reconstruction [Died]
July 10th 2014, 11:36 am by naknak

» Hi. I am new here
April 26th 2014, 4:01 pm by altshiftkey

» What's your favorite sport?
January 1st 2014, 2:13 pm by m27frogy

» FlashLight Script
January 1st 2014, 2:11 pm by m27frogy

» Gun Making! [READ DESC]
January 1st 2014, 2:10 pm by m27frogy

» Hi, I am new here!
November 26th 2013, 3:33 pm by Keanu73

» Improve Coding
October 26th 2013, 1:12 pm by pook03

» Simple Button
September 1st 2013, 6:19 pm by branefreez


Share | 
 

 C++ script

View previous topic View next topic Go down 
AuthorMessage
ninga95
Administrator
Administrator
avatar

Posts : 122
Join date : 2010-07-30
Age : 21

PostSubject: C++ script   February 22nd 2011, 10:34 pm

Look at this

Code:
#include <iostream>
#include <cmath>
int main ()
{
using namespace std;

double num1;
cout << "Pick your number.." << endl;
cin >> num1;
double num2;
num2 = sqrt(num1);
cout << "The sqaure root of " << num1 << " is " << num2 << endl;
system("pause");
return 0;
}

What this does is brings up a output and says "Pick your number" Then you insert a number and i mean any number, press enter, and it tells you the square root of that number EPIC.
Back to top Go down
Guest
Guest



PostSubject: Re: C++ script   February 22nd 2011, 10:55 pm

Okay?

Is cmath a standard C++ library? I'm learning from a book I got, and it hasn't mentioned the libraries yet, though I haven't read too far into it yet :/

(laziness ftw :P)
Back to top Go down
ninga95
Administrator
Administrator
avatar

Posts : 122
Join date : 2010-07-30
Age : 21

PostSubject: Re: C++ script   February 22nd 2011, 11:03 pm

Correct cmath is a library, and when you use it like that you can use any built in math function C++ provides
Back to top Go down
Supernapalm
Expert Scripter
Expert Scripter


Posts : 393
Join date : 2011-01-17

PostSubject: Re: C++ script   February 25th 2011, 11:13 pm

im about to get a book of C
Back to top Go down
http://hackthissite.org
naknak
Administrator
Administrator
avatar

Posts : 878
Join date : 2010-07-30

PostSubject: Re: C++ script   February 25th 2011, 11:39 pm

I doubt you would necessarily need C or C++. The only good thing about them is they take nearly no system resources compared to others, but they take a lot longer to write. C or C++ should only be used if you actually need those spare resources, which in most cases you don't. Well, you won't need it unless you hack often...
Back to top Go down
ninga95
Administrator
Administrator
avatar

Posts : 122
Join date : 2010-07-30
Age : 21

PostSubject: Re: C++ script   February 26th 2011, 2:09 am

No C++ can be used to make files, 3D games, or even 2D games, but we don't need it for a site. What we need is PHP, HTML, XML, and CSS.
Back to top Go down
blueymaddog
Administrator
Administrator
avatar

Posts : 1081
Join date : 2010-12-09
Age : 18

PostSubject: Re: C++ script   March 8th 2011, 7:00 am

I feel like making my own math functions. I haven't made functions in C++ yet so syntax will probably be completely wrong:

public static decimal sqrt(int number) return decimal number^0.5;

:\ any good?

_________________
blueymaddog
Administrator • Moderator • Expert Scripter
PM: blueymaddog
<+1 post. ujelly?>
Back to top Go down
ninga95
Administrator
Administrator
avatar

Posts : 122
Join date : 2010-07-30
Age : 21

PostSubject: Re: C++ script   April 23rd 2011, 12:24 pm

ninga95 wrote:
Look at this

Code:
#include <iostream>
#include <cmath>
int main ()
{
double num1;
std::cout << "Pick your number.." << std::endl;
cin >> num1;
double num2;
num2 = sqrt(num1);
std::cout << "The sqaure root of " << num1 << " is " << num2 << std::endl;
getch();
return 0;
}

What this does is brings up a output and says "Pick your number" Then you insert a number and i mean any number, press enter, and it tells you the square root of that number EPIC.


Last edited by ninga95 on April 23rd 2011, 12:26 pm; edited 1 time in total
Back to top Go down
ninga95
Administrator
Administrator
avatar

Posts : 122
Join date : 2010-07-30
Age : 21

PostSubject: Re: C++ script   April 23rd 2011, 12:26 pm

I edited it. :} And accidentally pressed quote
Back to top Go down
Guest
Guest



PostSubject: Re: C++ script   August 6th 2011, 1:15 am

blueymaddog wrote:
I feel like making my own math functions. I haven't made functions in C++ yet so syntax will probably be completely wrong:

public static decimal sqrt(int number) return decimal number^0.5;

:\ any good?

Not quite. You don't need public static because it's not a member of any class.
Also, decimal would be double.

The only problem is that you'd have to
Code:
 #include <cmath>
to get the pow function. cmath also has the sqrt function built in, so making your own would be redundant. in C++, the ^ operator is used on a bitwise level, and represents XOR. I've seen an inverse sqrt done on a bitwise level, which is, I think, the only way to make it without redundancy.

Back to top Go down
slayer9365
Expert Scripter
Expert Scripter
avatar

Posts : 233
Join date : 2010-07-31
Age : 22

PostSubject: Re: C++ script   August 6th 2011, 1:15 am

The member 'pwnedu46' has done the following action : Dice Roll

'Test' : 4
Back to top Go down
m27frogy
The Garbageman
avatar

Posts : 336
Join date : 2011-06-23

PostSubject: Re: C++ script   August 13th 2011, 1:10 pm

Quote :
No C++ can be used to make files, 3D games, or even 2D games, but we don't need it for a site. What we need is PHP, HTML, XML, and CSS.

Did you forget to mention XHTML? That's my favorite.
Back to top Go down
myrco919
Intermediate Scripter
Intermediate Scripter
avatar

Posts : 190
Join date : 2011-01-21
Age : 19
Location : Holland

PostSubject: Re: C++ script   October 20th 2011, 7:34 pm

m27frogy wrote:
Quote :
No C++ can be used to make files, 3D games, or even 2D games, but we don't need it for a site. What we need is PHP, HTML, XML, and CSS.

Did you forget to mention XHTML? That's my favorite.

It's unusualy, but sometimes C++ IS used for websites.
Back to top Go down
IsAPotato
Novice Scripter
Novice Scripter
avatar

Posts : 16
Join date : 2011-06-04
Location : California

PostSubject: Re: C++ script   December 11th 2011, 12:28 pm

I <3 Javascript. /sarcasm
Back to top Go down
blueymaddog
Administrator
Administrator
avatar

Posts : 1081
Join date : 2010-12-09
Age : 18

PostSubject: Re: C++ script   February 4th 2012, 7:03 am

pwnedu46 wrote:
blueymaddog wrote:
I feel like making my own math functions. I haven't made functions in C++ yet so syntax will probably be completely wrong:

public static decimal sqrt(int number) return decimal number^0.5;

:\ any good?

Not quite. You don't need public static because it's not a member of any class.
Also, decimal would be double.

The only problem is that you'd have to
Code:
 #include <cmath>
to get the pow function. cmath also has the sqrt function built in, so making your own would be redundant. in C++, the ^ operator is used on a bitwise level, and represents XOR. I've seen an inverse sqrt done on a bitwise level, which is, I think, the only way to make it without redundancy.


Oh, I'm so used to C# that I added public static to it...

_________________
blueymaddog
Administrator • Moderator • Expert Scripter
PM: blueymaddog
<+1 post. ujelly?>
Back to top Go down
Sponsored content




PostSubject: Re: C++ script   

Back to top Go down
 
C++ script
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Chess Script
» Autohotkey script for melee barbarian
» Awesome (FREE) gun script!
» Gun Movement Script? Tutorial #2
» Walking Animation Script(Help)

Permissions in this forum:You cannot reply to topics in this forum
A Roblox Community :: Questions and Help :: Scripting-
Jump to: