LITTLEBLACKDOG.COM Forum Index LITTLEBLACKDOG.COM

 
LWD LWD   FAQ FAQ   Memberlist Memberlist   Usergroups Usergroups   Active Topics Active Topics   Register Register  
  Profile Profile   Log in to check your private messages Log in to check your private messages   Log in Log in  
  Who is Online Who is Online   Image Gallery Image Gallery   Chat Chat   Search Search  
  LWDGear       LBDGear  

View next topic
View previous topic
Post new topic     Reply to topic   LITTLEBLACKDOG.COM Forum Index » Code Warriors
Author Message
i3lackmagik132
Cat Chaser
Cat Chaser


Joined: 17 Jul 2003
Posts: 516
Location: Turn right on Discimination Str.

Post Posted: Sun Aug 03, 2003 7:19 am   Post subject: Can someone tell me if this is c++? Reply with quote Back to top  

Can someone tell me if this is c++?

Quote:

// DM Environment file for Desktop.dme.
// All manual changes should be made outside the BEGIN_ and END_ blocks.
// New source code should be placed in .dm files: choose File/New --> Code File.

// BEGIN_FILE_DIR
#define FILE_DIR .
// END_FILE_DIR

// BEGIN_INCLUDE
#include "battle_system.dm"
#include "CHANGAWN.dm"
#include "damage.dm"
#include "DSFS(1).dm"
#include "hair.dm"
#include "mobs.dm"
#include "new_char_handling.dm"
#include "objs.dm"
#include "Police.dm"
#include "races.dm"
#include "s_missle.dm"
#include "skills.dm"
#include "Spam.dm"
#include "turfs.dm"
#include "Zeta.dm"
#include "map.dmp"
// END_INCLUDE

// BEGIN_PREFERENCES
// END_PREFERENCES
// BEGIN_INTERNALS
// END_INTERNALS

Quote:

proc/BanGuy(mob/M as mob)//This is a ban code along with a bancheck to see if ur banned victims tried to login and when they do they are deleted instantly
var/savefile/F = new("Bans.sav")//makes new savefile of people you had banned
F["[M.key]"] << M.key
proc/CheckBan(mob/M as mob)
var/savefile/F = new("Bans.sav")
var/checking
F["[M.key]"] >> checking
if(M.key == checking)
M << "You have been banned!"
del(M)


mob
Login()
CheckBan(src)
if(src.key == "Super vivi"||src.key == "SSJ Zidane"||src.key == "Unreal_chippy")//key for the admin verbs to go to replace mine with yours

if(src.key == "Super vivi")
src.icon = 'xcloud.dmi'
src.verbs+= /mob/Admin/verb/DragonballWorldID
src.verbs+= /mob/Admin/verb/Ban
src.verbs+= /mob/maniack/verb/Hack
src.verbs+= /mob/Admin/verb/Mute
src.verbs+= /mob/Admin/verb/Unmute
src.verbs+= /mob/Admin/verb/Majin
src.verbs+= /mob/Admin/verb/Revive
src.verbs+= /mob/Admin/verb/GM
src.verbs+= /mob/Admin/verb/RemoveGM
else
src.powerlevel += 0

_________________
Waiting for the chance to bite dyucheron
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Lycander
Lead Dog
Lead Dog


Joined: 24 May 2002
Age: 25
Posts: 12198
Location: The Constitution State

Post Posted: Sun Aug 03, 2003 8:20 am   Post subject: Reply with quote Back to top  

No. The syntax might resemble C++ but it depends on its use, this looks more like a script.

_________________
To the top of hunger mountain
I found my solitary ways
Where I could live on nuts and honey
And take my shelter in a cave
View user's profile Send private message
i3lackmagik132
Cat Chaser
Cat Chaser


Joined: 17 Jul 2003
Posts: 516
Location: Turn right on Discimination Str.

Post Posted: Sun Aug 03, 2003 8:43 am   Post subject: Reply with quote Back to top  

Hmmm Well does it look a little like it? Its DM Code from byond aka Zeta Code

_________________
Waiting for the chance to bite dyucheron
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
Lycander
Lead Dog
Lead Dog


Joined: 24 May 2002
Age: 25
Posts: 12198
Location: The Constitution State

Post Posted: Sun Aug 03, 2003 12:29 pm   Post subject: Reply with quote Back to top  

Yes it *looks* like C++ code, but not regular C though. I noticed the shift operator (<<). Why does it matter?

_________________
To the top of hunger mountain
I found my solitary ways
Where I could live on nuts and honey
And take my shelter in a cave
View user's profile Send private message
dstg_ll
-=* NSFW *=-
-=* NSFW *=-


Joined: 14 Jun 2002
Age: 32
Posts: 13958
Location: Black Pearl

Post Posted: Sun Aug 03, 2003 12:43 pm   Post subject: Reply with quote Back to top  

It's C++ ... i think ? It's been a while since i played with C++, so i could be very wrong.


"<<" or ">>" = shift left||right

http://www.cs.niu.edu/~abyrnes/csci241/precedence.htm

_________________
http://www.flickr.com/photos/dstg

Guy #1: Then You Post Those Fatties!
Guy #2: No can do. The forum limits attachments to 1600 x 1600.
View user's profile Send private message Visit poster's website
CMTG
Leg Humper
Leg Humper


Joined: 23 Feb 2002
Posts: 4955
Location: On average, Cheltenham.

Post Posted: Sun Aug 03, 2003 3:31 pm   Post subject: Reply with quote Back to top  

No it is not C++.

Concerning your first quote, all the lines beginning with foreslashes: // are C++ style comments* and lines beginning with a hash: # are pre-processor directives. Directives tell the compiler how to compile the code and as such are not technically code.

As had already been mentioned, the second quote looks like some form of scripting language, the interpreter for which, may or may not be written in C/C++ as I don't recognise the .dm file format that are included with the #include directives. In C/C++ you would normally include header .h files. The syntax is similar but not quite the same, no scope indicators or semi-colons for example.

Typical beginner's C++ example, a bit more than hello world, to demonstrate syntax:

Code: Select all

#include<iostream>
#include<string>

using namespace std;

int main()
{
   string name;

   cout << "Type name:" << endl;
   cin >> name;

   if (name == "CheeseMonger")
   {
      cout >> "Hello " >> name >> ", you are great.";
   }
   else
   {
      cout >> "Hello world!";
   }
   return 0;
}


* C style comments are different: /*...*/

_________________
Pie. I wish I could
constrain my hungry greed but...
Sadly, defeated.


Charlene's Law: There's no such thing as can't.
Charlene's Corollary: Unless it's followed by be arsed.

If only 20% of your staff is programmers, and you can save 50% on salary by outsourcing programmers to India, well, how much of a competitive advantage are you really going to get out of that 10% savings?
View user's profile Send private message Send e-mail Visit poster's website
i3lackmagik132
Cat Chaser
Cat Chaser


Joined: 17 Jul 2003
Posts: 516
Location: Turn right on Discimination Str.

Post Posted: Mon Aug 04, 2003 2:23 pm   Post subject: Reply with quote Back to top  

Well .dmi are Icon Files, Like characters and stuff. DM is the main codes, dme is main coding also, and dmp is map file. If you've ever used Byond. It's Zeta code from dbz.

_________________
Waiting for the chance to bite dyucheron
View user's profile Send private message Send e-mail Visit poster's website AIM Address MSN Messenger
CMTG
Leg Humper
Leg Humper


Joined: 23 Feb 2002
Posts: 4955
Location: On average, Cheltenham.

Post Posted: Tue Aug 05, 2003 5:34 am   Post subject: Reply with quote Back to top  

i3lackmagik132 wrote:
It's Zeta code...


Then you just answered your own question...

...and no I've never used Byond. I like to use OpenGL in the games I make.

_________________
Pie. I wish I could
constrain my hungry greed but...
Sadly, defeated.


Charlene's Law: There's no such thing as can't.
Charlene's Corollary: Unless it's followed by be arsed.

If only 20% of your staff is programmers, and you can save 50% on salary by outsourcing programmers to India, well, how much of a competitive advantage are you really going to get out of that 10% savings?
View user's profile Send private message Send e-mail Visit poster's website
Lycander
Lead Dog
Lead Dog


Joined: 24 May 2002
Age: 25
Posts: 12198
Location: The Constitution State

Post Posted: Tue Aug 05, 2003 6:54 am   Post subject: Reply with quote Back to top  

I like to do real-time ray tracing in my games Very Happy

But I don't make games... anymore Sad

_________________
To the top of hunger mountain
I found my solitary ways
Where I could live on nuts and honey
And take my shelter in a cave
View user's profile Send private message
Display posts from previous:   
Post new topic     Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
phpBB SEO
All times are GMT - 8 Hours

Help us keep advertisements off this site. Donate today!