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…
Please show us one (or multiple) of your scripts.
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);
}