SRL Archive - Other Scripts

Random Student Generator


Sdcit

2006-05-07 22:51:53

Randomly generates a students profile:

ex.

[php]
First Name : Daniel
Last Name : Saw
Gender : Male
Weigth : 190 Lbs.
Heigth : 5 feet 2 inches
Room : 7
[/php]

[php]
First Name : Stephany
Last Name : Gredath
Gender : Female
Weigth : 190 Lbs.
Heigth : 5 feet 5 inches
Room : 8
[/php]

or my favorite:

[php]
First Name : Harmony
Last Name : Chua
Gender : Female
Weigth : 130 Lbs.
Heigth : 5 feet 4 inches
Room : 8
[/php]





Script:


[php]
program New;
type
Student = Record
Name , Last : Array[1..21] of String;
Room, Length, down : Array[1..10] of String;
Gender: Array[1..2] of String;
end;

var
Sync: Student;
x:Integer;

procedure ArrayDeclare;
begin
Sync.Name[1] := 'Allan ';
Sync.Name[2] := 'Wade ';
Sync.Name[3] := 'Daniel ';
Sync.Name[4] := 'Kane ';
Sync.Name[5] := 'Tyler ';
Sync.Name[6] := 'Steven ';
Sync.Name[7] := 'Chris ';
Sync.Name[8] := 'Lissie ';
Sync.Name[9] := 'Veronica ';
Sync.Name[10] := 'Harmony ';
Sync.Name[11] := 'Bo Bo ';
Sync.Name[12] := 'Raman ';
Sync.Name[13] := 'Austin ';
Sync.Name[14] := 'David ';
Sync.Name[15] := 'John ';
Sync.Name[16] := 'Elizibeth ';
Sync.Name[17] := 'Zach ';
Sync.Name[18] := 'Minny ';
Sync.Name[19] := 'Stephany ';
Sync.Name[20] := 'Tiffany ';
Sync.Name[21] := 'Lachlan ';

Sync.Last[1] := 'Demuth';
Sync.Last[2] := 'Gredath';
Sync.Last[3] := 'Makar';
Sync.Last[4] := 'Saw';
Sync.Last[5] := 'Fu';
Sync.Last[6] := 'Chua';
Sync.Last[7] := 'Law';
Sync.Last[8] := 'Swiss';
Sync.Last[9] := 'Merdith';
Sync.Last[10] := 'Twitin';
Sync.Last[11] := 'Rekjacik';
Sync.Last[12] := 'Natarajin';
Sync.Last[13] := 'Smith';
Sync.Last[14] := 'Oddjobb';
Sync.Last[15] := 'Singsong';
Sync.Last[16] := 'jakick';
Sync.Last[17] := 'Dranian';
Sync.Last[18] := 'Deviath';
Sync.Last[19] := 'Phenton';
Sync.Last[20] := 'Reqj';
Sync.Last[21] := 'Neeley';

Sync.Room[1] := 'Room : 1';
Sync.Room[2] := 'Room : 2';
Sync.Room[3] := 'Room : 3';
Sync.Room[4] := 'Room : 4';
Sync.Room[5] := 'Room : 5';
Sync.Room[6] := 'Room : 6';
Sync.Room[7] := 'Room : 7';
Sync.Room[8] := 'Room : 8';
Sync.Room[9] := 'Room : 9';
Sync.Room[10] := 'Room : 10';

Sync.down[1] := '100 Lbs.';
Sync.down[2] := '110 Lbs.';
Sync.down[3] := '120 Lbs.';
Sync.down[4] := '130 Lbs.';
Sync.down[5] := '140 Lbs.';
Sync.down[6] := '150 Lbs.';
Sync.down[7] := '160 Lbs.';
Sync.down[8] := '170 Lbs.';
Sync.down[9] := '180 Lbs.';
Sync.down[10]:= '190 Lbs.';

Sync.Length[1] := '5 feet 2 inches';
Sync.Length[2] := '4 feet 9 inches';
Sync.Length[3] := '6 feet 1 inches';
Sync.Length[4] := '5 feet 5 inches';
Sync.Length[5] := '4 feet 6 inches';
Sync.Length[6] := '100 feet 20 inches';
Sync.Length[7] := '5 feet 7 inches';
Sync.Length[8] := '5 feet 4 inches';
Sync.Length[9] := '5 feet 8 inches';
Sync.Length[10]:= '4 feet 4 inches';

Sync.Gender[1] := 'Gender : Male';
Sync.Gender[2] := 'Gender : Female';


end;



begin
ClearDebug;
ArrayDeclare;
x:= Random(21)+1;
begin
Writeln('First Name : '+Sync.Name[x]);
end;
x:= Random(21)+1;
begin
Writeln('Last Name : '+Sync.Last[x]);
end;
x:= Random(2)+1;
begin
Writeln(Sync.Gender[x]);
end;
x:= Random(10)+1;
begin
Writeln('Weigth : '+Sync.down[x]);
end;
x:= Random(10)+1;
begin
Writeln('Heigth : '+Sync.Length[x]);
end;
x:= Random(10)+1;
begin
Writeln(Sync.Room[x]);
end;
end.
[/php]

I made this script to test my knowledge of Type and Record

Dark_Sniper

2006-05-07 23:11:55

From: Sdcit

my favorite:

[php]
First Name : Harmony
Last Name : Chua
Gender : Female
Weigth : 130 Lbs.
Heigth : 5 feet 4 inches
Room : 8
[/php]



you should really get over her if she wont talk to you,
or ask her later but before you ask her get to know her a bit more(but try not to stalk her lol) lol sd you need a lot more tips.



lol i guesse this is a good way to use arrays :p and type and record…

bumfluff120

2006-05-12 04:38:03

Sorry i spose this doesn't reallt matter but you spelt weight wrong

XxKanexX

2006-05-12 07:40:11

Experimenting with Type? It's good, ey ;)

Although you should make the weight, rooms, ect a bit more vast. Not much variety there..


Sync.Down:= inttostr(90 + Random(100)) + 'Lbs.';
;)

Sdcit

2006-05-12 10:42:21

ghehe, i was seeing if i could use an array :p. I'll see what i can do :p

XxKanexX

2006-05-12 10:57:32

Just do something like:


type HeightP = record
Feet, Inches: integer;
end;

function Weight: string;
begin
result:= inttostr(90 + Random(100)) + ' Lbs.';
end;

function Room: string;
begin
result:= inttostr(1 + Random(10));
end;

function Height: HeightP;
begin
result.Feet:= 4 + Random(4);
result.Inches:= 1 + Random(9);
end;

function Gender: string;
begin
if (random(2) = 0) then
result:= 'Male.'
else
result:= 'Female.';
end;

var H: HeightP;
begin
Cleardebug;
Writeln('First Name: ..');
Writeln('Last Name: ..');
Writeln('Gender: ' + Gender);
Writeln('Weight: ' + Weight);
H:= Height;
Writeln('Height: ' + inttostr(H.Feet) + ' feet ' + inttostr(H.inches) + ' inches.');
Writeln('Room: ' + Room);
end.
Just insert the naming thing ;)

SmarterChild

2007-01-13 15:14:49

ROFL
Fatty :P
First Name : Harmony
Last Name : Phenton
Gender : Female
Weigth : 170 Lbs.
Heigth : 4 feet 6 inches
Room : 3
AND ANOTHER
First Name : David
Last Name : Singsong
Gender : Female
Weigth : 180 Lbs.
Heigth : 4 feet 9 inches
Room : 2

LMAO
First Name : Kane
Last Name : Chua
Gender : Male
Weigth : 190 Lbs.
Heigth : 5 feet 5 inches
Room : 8

jibwin

2007-03-14 00:01:28

i ghot a crazy one !

First Name : Veronica
Last Name : Smith
Gender : Female
Weigth : 140 Lbs.
Heigth : 100 feet 20 inches
Room : 5

Echoes

2007-04-03 22:47:00

Sounds like something the goverment wud use… :P