Jeśli chcesz wziąć udział w dyskusjach na forum - zaloguj się. Jeżeli nie masz loginu - poproś o członkostwo.
Vanilla 1.1.4 jest produktem Lussumo. Więcej informacji: Dokumentacja, Forum.
mwa currentplayer :bp2
program hello;
uses crt;
type
player = record
gold : smallInt;
score : cardinal;
end;
var
players : array[0..3] of ^player;
playerOne : player;
PlayerTwo : player;
currentplayer: ^player;
currentplayer_: ^player;
begin
players[0] := @playerOne;
players[1] := @playerTwo;
currentplayer := players[0];
currentplayer.gold := 3;
currentplayer_ := players[1];
currentplayer_.gold := 4;
writeln('1p gold = ', players[0].gold);
writeln('2p gold = ', players[1].gold);
ReadKey;
end.
program hello;
uses crt;
type
player = record
gold : smallInt;
score : cardinal;
end;
var
players : array[0..3] of ^player;
playerOne : player;
PlayerTwo : player;
currentplayer : ^player;
begin
players[0] := @playerOne;
players[1] := @playerTwo;
currentplayer := players[0];
currentplayer^.gold := 1;
currentplayer := players[1];
currentplayer^.gold := 8;
writeln('1p gold = ', players[0].gold);
writeln('2p gold = ', players[1].gold);
ReadKey;
end.
p1[0]:= Char(peek(chessman) xor invert); Inc(chessman);
lib/chessgui.pas (45,13) Error: Array type required
ship0: TShip;
ship1: TShip;
ship2: TShip;
shipmatrix: array [0..NUMBEROFSHIPS-1] of pointer = (@ship0, @ship1, @ship2);
tshp : ^TShip;
tshp:=shipmatrix[0];
write(tshp^.speed);
program hello;
uses crt;
type
TShip = record
gold : smallInt;
speed : cardinal;
end;
var
ship0: TShip;
ship1: TShip;
ship2: TShip;
tshp : ^TShip;
shipmatrix: array [0..2] of pointer = (@ship0, @ship1, @ship2);
begin
ship0.speed := 5;
ship1.speed := 10;
tshp := shipmatrix[0];
writeln(tshp.speed);
tshp := shipmatrix[1];
writeln(tshp.speed);
ReadKey;
end.
type
player = record
gold : smallInt;
inventory: TString;
end;
var
players : array[0..3] of ^player;
playerOne : player;
PlayerTwo : player;
currentplayer : ^player;
weaponName: TString;
localinv:TString;
begin
players[0] := @playerOne;
players[1] := @playerTwo;
currentplayer := players[1];
currentplayer^.inventory := '----';
localinv := currentplayer^.inventory;
localinv[1] := 'B';
currentplayer^.inventory := localinv;
currentplayer^.inventory := @localinv;
currentplayer^.inventory := $0a;
program hello;
uses crt;
type
player = record
gold : smallInt;
inventory : TString;
end;
var
players : array[0..3] of ^player;
playerOne : player;
PlayerTwo : player;
currentplayer : ^player;
weaponName : TString;
localinv : TString;
begin
players[0] := @playerOne;
players[1] := @playerTwo;
currentplayer := players[1];
currentplayer^.inventory := '----';
localinv := currentplayer^.inventory;
localinv[1] := 'B';
currentplayer^.inventory := concat('', localinv);
writeln('1p inventory = ', players[0].inventory);
writeln('2p inventory = ', players[1].inventory);
ReadKey;
end.
type
TString = string[32];
player = record
gold : smallInt;
inventory: TString;
end;
var
players : array[0..3] of ^player;
playerOne : player;
PlayerTwo : player;
currentplayer : ^player;
weaponName: TString;
localinv:TString;
begin
players[0] := @playerOne;
players[1] := @playerTwo;
currentplayer := players[1];
currentplayer^.inventory := '----';
localinv := currentplayer^.inventory;
localinv[1] := 'B';
currentplayer^.inventory := localinv;
writeln('1p inventory = ', players[0].inventory);
writeln('2p inventory = ', players[1].inventory);
program hello;
uses crt;
type
player = record
gold : smallInt;
inventory: TString;
end;
var
players : array[0..3] of ^player;
playerOne : player;
PlayerTwo : player;
currentplayer : ^player;
weaponName : TString;
localinv : TString;
begin
players[0] := @playerOne;
players[1] := @playerTwo;
currentplayer := players[1];
currentplayer.inventory := '----';
localinv := currentplayer^.inventory;
localinv[1] := 'B';
currentplayer.inventory := localinv;
writeln('1p inventory = ', players[0].inventory);
writeln('2p inventory = ', players[1].inventory);
ReadKey;
end.
localinv := currentplayer^.inventory;
players[0] := @playerOne;
players[1] := @playerTwo;
currentplayer := players[0];
currentplayer^.inventory := '----';
localinv := currentplayer^.inventory;
localinv[1] := 'B';
currentplayer^.inventory := localinv;
currentplayer := players[1];
currentplayer^.inventory := '----';
localinv := currentplayer^.inventory;
localinv[2] := 'C';
currentplayer^.inventory := localinv;
currentplayer := players[0];
localinv := currentplayer^.inventory;
localinv[3] := 'D';
currentplayer^.inventory := localinv;
writeln('inv1 = ', players[1].inventory);
writeln('inv0 = ', players[0].inventory);
program hello;
uses crt;
type
player = record
gold : smallInt;
inventory : TString;
end;
var
players : array[0..3] of ^player;
playerOne : player;
PlayerTwo : player;
currentplayer : ^player;
localinv : TString;
begin
players[0] := @playerOne;
players[1] := @playerTwo;
currentplayer := players[0];
currentplayer.inventory := '----';
localinv := currentplayer^.inventory;
localinv[1] := 'B';
currentplayer.inventory := localinv;
writeln(word(@currentplayer));
writeln(localinv);
writeln('inv1 = ', players[1].inventory);
writeln('inv0 = ', players[0].inventory);
currentplayer := players[1];
currentplayer.inventory := '----';
localinv := currentplayer^.inventory;
localinv[2] := 'C';
currentplayer.inventory := localinv;
writeln(word(@currentplayer));
writeln(localinv);
writeln('inv1 = ', players[1].inventory);
writeln('inv0 = ', players[0].inventory);
currentplayer := players[0];
localinv := currentplayer^.inventory;
localinv[4] := 'D';
currentplayer.inventory := localinv;
writeln(word(@currentplayer));
writeln(localinv);
writeln('inv1 = ', players[1].inventory);
writeln('inv0 = ', players[0].inventory);
ReadKey;
end.
// dodane do powyższego kodu
localinv := '2---';
currentplayer := players[0];
writeln('---->', currentplayer^.inventory);
const
DISPLAY_LIST_ADDRESS_CONSOLE = $2000;
TXT_ADDRESS = $8000;
{$r 'resources.rc'}
DISPLAY_LIST_ADDRESS_CONSOLE rcasm 'dlist_console.asm'
dl_start
dta DL_DLI + DL_BLANK8
dta DL_MODE_40x24T2 + DL_LMS, a(TXT_ADDRESS)
:22 dta DL_MODE_40x24T2
dta DL_BLANK1
dta DL_MODE_40x24T2
dta DL_JVB, a(dl_start)
program hello;
uses crt;
Type
DrawingObject = Object
x, y : byte;
procedure InitDefaultValues;
end;
Rectanglep = ^DrawingObject;
procedure DrawingObject.InitDefaultValues;
begin
x:=2;
y:=1;
end;
Var
Rectangle : DrawingObject;
Rectanglepv:Rectanglep;
ppoiner:pointer;
begin
Rectangle.InitDefaultValues;
ppoiner:=@Rectangle;
Rectanglepv:=@Rectangle;
//Rectanglepv:=Rectanglep(ppoiner); {Illegal type conversion: // "POINTER" to //"RECTANGLEP"}
// secound
write(Rectanglepv^.x);
Rectanglepv^.InitDefaultValues; {identifier idents no member 'INITDEFAULTVALUES'}
ReadKey;
end.
var p_data: array[0..3] of pointer;
var p0DataS : array [0..4] of byte = (0,0,0,0,0);
procedure moveP(p, x, y, pmax : byte);
begin
// vpos
move(p_data[p], pointer(pm_mem + pm_offset + pm_size * p + y), pmax);
// hpos
Poke(53248 + p, x);
end;
var p_data: array[0..3] of pointer;
var p0DataS : array [0..4] of byte = (0, 0, 0, 0, 0);
...
p_data[0] := @p0DataS;
...
...
...
var z : ^byte;
...
z := p_data[p];
inc(z);