Problem Set 0: Getting Started
These problem sets have been writen as a tutorial for those wishing to code on the Merentha Builders port. To use this you will need to have been made a coder on that port. At that time you will also have been given a short introduction and set on your way.
Setting it Up
The commands in LPC as a coder are simular to the ones in Linux or UNIX and somewhat simular to the old DOS command prompts. To make things easy on us now, type this:
cd
I will explain that command later.
Now if you haven't yet you should set your prompt to display your current directory. This will make things a lot easier in the future for you. The command is:
set PROMPT $D >
Now, if your prompt hasn't changed, quit and come back from the Builders and we will be set to begin.
Basic Commands
Here are some basic UNIX commands:
- cd - change directory (folders)
- ls - list the files in a given directory.
- cp - copy a file
- more - displays a file on the screen
- mv - move a file
- rm - remove a file
- mkdir - make a new directory (folder)
- rmdir - remove a directory (folder)
- update - updates the master object named in memory
- clone - creates a copy of the file named
Follow the following steps to discover how to use these commands.
cd [directory] changes into the directory named. If you don't name one it will take you to your home directory. Your home directory is where you should be doing all your work. So first off type:
cd
ls [directory] list the files in the directory named. If you don't name one it will list the files in your current directory. Your current directory is displayed as your prompt and right now should be /realms/yourname/ Now, type
ls
That lists all the files in your directory, there should only be a few files there right now.
cp
So now lets put these 3 commands to work. You have access to the Cabeiri area on Builders. So lets go there and take a look at the code. Type:
cd /domains/Praxis
Then type:
ls
This will cause a couple of lines of text to scroll across your screen. In the future you can type:
ls -m
Adding the -m will make the ls scroll though the more system so you can see the files easier if you wish to. Now lets chose a file to copy. Type:
cd obj/weapon
I will now take a moment to point out something. Notice that when we cd-ed into the Cabeiri area we used /domains/Praxis but when we cd-ed into the weapn directory we used obj/weapon. The point to look at is that one starts with a forwardslash / and the other doesn't. When you use a / at the start it means to start from the root directory structure. When you don't put the / at the front it means continue on from the current directory you are in. Also, in both cases we have a / in the middle. The / in the middle is to save time. We could have typed the following instead:
cd /domains
cd Praxis
cd obj
cd weapon
or we could have just typed cd /domains/Praxis/obj/weapon which saves us a lot of time.
Now get a listing of the files in your directory. It should look something like this:
1 beak.c 1 knife2.c 1 staff.c
1 bow.c 1 newbie_sword.c 1 sword.c
1 dagger.c 001 orc_slayer.c 1 sword2.c
1 horse_whip.c 1 rake.c 001 whammer.c
1 knife.c 004 ranger_bow.c
The number in front is not to important right now. bascilly it is a number representing how big the file is. Lets copy sword.c into our home directory. Type:
cp sword.c ~
Ok, whats with the ~? Well the ~ means your home directory. You could also have typed cp sword.c /realms/yourname but this way was shorter.
After typing that you should see a line like:
Copied: /domains/Praxis/obj/weapon/sword.c to /realms/petrarch/sword.c
to tell you the file was copied correctly.
more
cd
Get a listing of your directory. Notice that there is now a file called sword.c. Lets now see what is in that file. Type:
more sword.c
It should look something like this:
--==** /domains/Praxis/obj/weapon/sword.c **==--
#include
That first line isn't part of the file, it just shows you what the filename is. That is because it is possbile to use wildcards. For example I could have typed more swo* and gotten the same result. Try it. The * is a pattern matching character.
We will be editing the sword file later. So let us make a backup of the sword.c file incase we mess it up later on. To make a backup copy type:
cp sword.c oldsword.c
Now when you list the directory you will see an oldsword.c file.
mv
mv sword.c mysword.c
Then take another listing of your directory. Notice now there is no more sword.c file but there is a new file mysword.c Basiclly you have renamed the file.
rm
rm sword.c
And then take another directory lising. Notice that the
sword.c file is now gone again.
mkdir
mkdir area
Then take a directory lising. There is now a file called area/ in your directory. Notice that directories don't have a sile number and end in a / so you know they are directories. You can cd into that directy if you want.
rmdir
Play around with creating and delete directoies, copying files and so on. Once you are confortable with these actions continue to the second part of this problem set.
Part 2 - Basic Coder Commands
More commands will be described later. Right now only two are important. Return to your home directory and we can start.
update [file] - updates a file after changes. For now type:
update mysword.c
If any changes were made to the file, type that command again to make the changes load into memory. Of course no changes were made, and the next problem set describes how to make them. If you did not enter a file name you will update the room you are in.
clone
clone mysword.c
And you now have your very own weapon.