View difference between Paste ID: XCv25csM and MxPVtQX7
SHOW: | | - or go back to the newest paste.
1
/*PROGRAM PAWNO ? THIS IS A COMMENT, THE COMPILER IS PAWNO*/
2
new alph[4], // 0 .. 3 ( since pawn doesn't allow 1..3) and 4 means lower than 4
3-
	Let,
3+
	Let, //comma operator ','
4
	Inc;
5
6
{ //this is not necessary, it just means start a new block of code, it's no needed but the pascal has BEGIN and END so I thought I'd put it here to recreate the pascal
7
	Inc = 0;
8
	Let = 'G';
9
	
10
	for(Inc = 1; Inc != 3; Inc++) // The array is actually 0-3 but since pawn cannot dislodge the 0, we start from 1 and goto 3
11
	{
12
		alph[Inc] = Let;
13
	}
14
	for(Inc = 1; Inc != 3; Inc++)
15
	{
16
		WriteIn(alpha[Inc]); //WriteIn is a custom function that won't compile
17
	}
18
}
19
20
// COMMENT - USING DO-WHILE INSTEAD OF FOR
21
22
{
23
	Inc = 0;
24
	Let = 'G';
25
	
26
	do // start a loop using the do-while way
27
	{
28
		alph[Inc] = Let;
29
		++Inc; // this means add 1 (++ operator) before if it was Inc++ it would've been add AFTER
30
	}
31
	while (Inc != 3);
32
	do
33
	{
34
		WriteIn(alpha[Inc]); //WriteIn is a custom function that won't compile
35
		++Inc;
36
	}
37
	while (Inc != 3);
38
}
39
40
// COMMENT - USING WHILE INSTEAD OF FOR
41
42
{
43
	Inc = 0;
44
	Let = 'G';
45
46
	while (Inc != 3) //start a loop using while function
47
	{
48
		alph[Inc] = Let;
49
		++Inc;
50
	}
51
	while (Inc != 3)
52
	{
53
		WriteIn(alpha[Inc]); //WriteIn is a custom function that won't compile
54
		++Inc;
55
	}
56
}