SRL Archive - Archive

xzer0bs - SRL Member Application


xzer0bs

2010-05-10 22:12:22

How Long have You Played Runescape?
10 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
Year of Java in highschool, C programming my freshman year of college


Are you a member of any other communities?
No


Tell us about yourself…
From: xzer0bs
Well I've been playing runescape since I was in 5th grade, my main charactor got banned back in one of the old autorune mass bans, they unbanned him a few months ago, and I decided to start playing again, I found this site again and realized I had made a username back in '07. I'm currently a student at Grand Valley State University going for electrical engineering. I took a year of Java programming in high school and a just finished a semester of c programming and I want to see what I can learn from you guys while playing a video game I enjoy.



Please show us one (or multiple) of your scripts.
I have a ton more on my flashdrive, these are just a few I had saved on my computer. 


/**
Lab 9 - Game of Life
* Author : Tony Marinelli
* Date : 3-29-2010
* inputs : Number of Generations
* outputs : Displays a 'Game of life'
*
*/
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include <time.h>
#include <string.h>
#include <stdlib.h>

void description(void);
int num_neighbors(int q, int j);
char life[27][27];
char round[27][27];
int main (void)
{
int gen,i,r,r1,r2,a,e,j,o,t,p,cat,q,turn,neighbors;
description();

printf("Enter how many generations you want:\n");
scanf("%d",&gen);
printf("\n");

a = rand() % 50 + 1;
a = a+250;
cat = 0;
for(t=0;t<27;t++)
{
for(p=0;p<27;p++)
{
life[t][p] = ' ';
}
}
/*
while(cat<=a)
{
r1 = (rand() % 25 + 1);
r2 = (rand() % 25 + 1);
if (life[r1][r2] == ' ')
{
life[r1][r2] = 'X';
cat = cat+1;
}
}
*/
life[2][3] = 'X';
life[3][4] = 'X';
life[4][2] = 'X';
life[4][3] = 'X';
life[4][4] = 'X';

/*This prints out the game*/
turn = 1;
printf("This is the %dst generation\n",turn);
for(e=1;e<26;e++)
{
for(o=1;o<26;o++)
{
printf("%c",life[e][o]);
}
printf("\n");
}
for(turn=2;turn<=gen;turn++)
{
/*this part looks through the world and finds how many neighbors*/
for(i=1;i<26;i++)
{
for(j=1;j<26;j++)
{
neighbors = num_neighbors(i,j);
if(neighbors >=4 || neighbors < 2)
{
round[i][j] = ' ';
}
if(((neighbors == 3) || (neighbors ==2)) && (life[i][j] == 'X'))
{
round[i][j] = life[i][j];
}
if((neighbors == 3) && (life[i][j] != 'X')){
round[i][j] = 'X';}

}
}
/*This prints out the game*/
printf("\nThis is generation %d \n",turn);
for(e=1;e<26;e++)
{
for(o=1;o<26;o++)
{
printf("%c",round[e][o]);
}
printf("\n");
}
for(e=1;e<26;e++)
{
for(o=1;o<26;o++)
{
life[e][o] = round[e][o];
round[e][o] = ' ';
}
printf("\n");
}

}
}
void description(void)
{
printf("This is a game of life\n");
}

int num_neighbors(int i, int j)
{
int count = 0;

if(life[i-1][j] == 'X'){
count = count + 1;}
if(life[i+1][j] == 'X'){
count = count + 1;}
if(life[i][j-1] == 'X'){
count = count + 1;}
if(life[i][j+1] == 'X'){
count = count + 1;}
if(life[i-1][j-1] == 'X'){
count = count + 1;}
if(life[i+1][j+1] == 'X'){
count = count + 1;}
if(life[i+1][j-1] == 'X'){
count = count + 1;}
if(life[i-1][j+1] == 'X'){
count = count + 1;}
return(count);
}





===========================





/**
Lab 7 - Text Processing
* Author : Tony Marinelli
* Date : 3-17-10
* inputs : String
* outputs : Charactor, word, and vowel count
*
*/
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include <time.h>
#include <string.h>


int count_char(int n, char a[]);
int count_words(int n, char a[]);
int count_vowels(int n, char a[]);





int main (void)
{
int count, words, vowels, charactors;
char str[250];
int read;
FILE *lab7;
int n=250;
lab7 = fopen("lab7.txt", "r");
if (lab7 == NULL)
{
printf("Cannot read file");
return(0);
}
printf("Would you like to read from a file, or type yourself?\n");
printf("1 to open file, 2 to type yourself");
scanf("%d", &read);

if (read == 1 || read == 2)
{
if (read == 2)
{
printf("Type the statement please :\n");
scanf("%*c");
fgets(str,n,stdin);
}
else
{
fgets(str, n, lab7);
}
}
charactors = count_char(n, str);
printf("There are %d charactors\n", charactors);
words = count_words(n, str);
printf("There are %d words\n", words);
vowels = count_vowels(n, str);
printf("There are %d vowels\n", vowels);
return(0);

}

int count_char(int n, char a[])
{

int size, blank, k;
char c;
blank = 0;
size = strlen(a);
for(k = 0; k<n; k++)
{
c = a[k];
if (c == ' ')
blank += 1;
}
size = (size - blank);
return(size);

}

int count_words(int n, char a[])
{
int count, k;
char *d;
count = 1;
d = strtok(a, " ");
for(k=1; k<n; k++)
{
d = strtok(NULL, " ");
if (d == NULL)
break;
else
count++;
}
return(count);
}

int count_vowels(int n, char a[])
{
int counter, k;
char c;
counter = 0;
for(k=0; k<n; k++)
{
c = a[k];
if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
counter = (counter + 1);
}
return(counter);
}

noidea

2010-05-10 22:16:32

Although your C is very nice, you must apply with a pascal script for runescape ;)
Thanks.

Wanted

2010-05-10 23:35:10

Looks promising, but we can not admit someone into members with out a SCAR or simba script that uses SRL fluently.

Sir R. M8gic1an

2010-05-13 12:28:51

Well, considering you already know C and Java, Pascal Script will probably be something you learn very fast.

Feel free to re-apply whenever you feel ready ;) There are several tutorials on what we expect to see in an application. :)

Good luck and welcome back!

~RM

xzer0bs

2010-05-16 16:11:29

I've read through a few of those tutorials and I will make a script as soon as I get a little more free time :)

Gu3st...

2010-05-16 17:24:13

Glad to hear that xzer0bs :) Looking forward to your application ^^

Daniel

2010-05-17 03:22:53

Umm, that code is pretty basic. If you want, I could port that code to Pascal (almost exactly how it is provided above) and you can see how simple it is :)

xzer0bs

2010-05-18 00:36:47

[QUOTE=Dan's The Man;710784]Umm, that code is pretty basic. If you want, I could port that code to Pascal (almost exactly how it is provided above) and you can see how simple it is :)[/QUOTE]

that would be awesome

Dgby714

2010-05-18 02:12:17

From: xzer0bs
that would be awesome


Lab7:
program Lab7;

const
str = 'Testing this small script...';

function count_char(s: string): integer;
var
I: integer;
begin
Result := Length(s);
for I := 1 to Length(s) do
if (s[I] = ' ') then
Dec(Result);
end;

function count_words(s: string): integer;
begin
if (Trim(s) = '') then
Result := 0
else
Result := Length(Explode(' ', s));
end;

function count_vowels(s: string): integer;
var
k: integer;
begin
Result := 0;
for k := 1 to Length(s) do
if ((s[k] = 'a') or (s[k] = 'e') or (s[k] = 'i') or (s[k] = 'o') or (s[k] = 'u')) then
Inc(Result);
end;

begin
WriteLn('There are ' + IntToStr(count_char(str)) + ' charactors');
WriteLn('There are ' + IntToStr(count_words(str)) + ' words');
WriteLn('There are ' + IntToStr(count_vowels(str)) + ' vowels');
end.

Lab9:
program Lab9;

const
Gen = 250;

var
life, round: array[0..27] of array[0..27] of string;

function num_neighbors(i, j: integer): integer;
begin
Result := 0;
if (life[i - 1][j] = 'X') then
Inc(Result);

if (life[i + 1][j] = 'X') then
Inc(Result);

if (life[i][j - 1] = 'X') then
Inc(Result);

if (life[i][j + 1] = 'X') then
Inc(Result);

if (life[i - 1][j - 1] = 'X') then
Inc(Result);

if (life[i + 1][j + 1] = 'X') then
Inc(Result);

if (life[i + 1][j - 1] = 'X') then
Inc(Result);

if (life[i - 1][j + 1] = 'X') then
Inc(Result);
end;

var
Row: string;
A, cat, r1, r2, I, J, turn, neighbors: integer;

begin
WriteLn('This is a game of life');
A := Random(27) + 1; //from 1 to about half of the board
IncEx(A, 250);
cat := 0;
for I := 0 to 26 do
for J := 0 to 26 do
life[I][J] := ' ';
life[2][3] := 'X';
life[3][4] := 'X';
life[4][2] := 'X';
life[4][3] := 'X';
life[4][4] := 'X';

while (cat <= a) do
begin
r1 := (Random(27) + 1); // 1 - 27
r2 := (Random(27) + 1);
if (life[r1][r2] = ' ') then
begin
life[r1][r2] := 'X';
cat := cat + 1;
end;
end;

turn := 1;
ClearDebug;
WriteLn('This is generation ' + IntToStr(turn) + '!');
for I := 1 to 25 do
begin
Row := '';
for J := 1 to 25 do
Row := Row + life[I][J];
WriteLn(Row);
end;
for turn := 2 to Gen do
begin
for I := 1 to 25 do
for J := 1 to 25 do
begin
neighbors := num_neighbors(I, J);
if ((neighbors >= 4) or (neighbors < 2)) then
round[i][j] := ' ';
if (((neighbors = 3) or (neighbors = 2)) and (life[i][j] = 'X')) then
round[i][j] := life[i][j];
if ((neighbors = 3) and (not (life[i][j] = 'X'))) then
round[i][j] := 'X';
end;
ClearDebug;
WriteLn('This is generation ' + IntToStr(turn) + '!');
for I := 1 to 25 do
begin
Row := '';
for J := 1 to 25 do
Row := Row + round[I][J];
WriteLn(Row);
end;
for I := 1 to 25 do
for J := 1 to 25 do
begin
life[I][J] := round[I][J];
round[I][J] := ' ';
end;
end;
end.

Ashur2Good

2010-05-26 05:51:37

Hmm, seems very promising :)

But, like others have said, you do need a scar script to get in.
Though if your pascal skills end up being as good as your C ones, then you'll make it :)

Goodluck for next time.
-Ashur