DataMuseum.dk

Presents historical artifacts from the history of:

CP/M

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about CP/M

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦f37519e57⟧ TextFile

    Length: 1664 (0x680)
    Types: TextFile
    Names: »OPTOPAD.PAS«

Derivation

└─⟦037dced94⟧ Bits:30003312 Elevopgave i styring af skildpadde til Piccolo
    └─ ⟦this⟧ »OPTOPAD.PAS« 

TextFile

program Optopad;(* Jens Vaaben 25-8-1986 *)
var
  ch:char;
  test,tempo,vent,pause:integer;
  tilstand,valg : byte;
(*-----------------------------------------*)
procedure tempovalg;
begin
  gotoxy(5,12);write('Indtast tempo (1 er langsomt, 5 er hurtigt): ');
  repeat
    read(kbd,ch);
  until ch in (.'1','2','3','4','5'.);
  val(ch,tempo,test);
  gotoxy(50,12);write(tempo);
  pause := (8-tempo)*40;
end;
(*-----------------------------------------*)
procedure indledning;
begin
  gotoxy(1,1);write(clrhom);
  gotoxy(31,5);write('O P T O -  P A D D E');
  gotoxy(31,6);write('********************');
  tempovalg;
  gotoxy(42,20);write('Tryk MELLEMRUM for at køre...');
  repeat
    read(kbd,ch);
  until ch=' ';
  ch:='K';
  gotoxy(42,19);write('Nu kører OPTO-PADDEN,');
  gotoxy(42,20);write('Tryk MELLEMRUM for at standse...');
end;  
(*-----------------------------------------*)
procedure flyt(var tilstand : byte);
begin
  for vent:=1 to pause do  
   port(.17.):=tilstand;
   for vent:=1 to pause do  
   port(.17.):=0;
end;
(*---her begynder det egentlige program----*)
begin
  indledning;
  repeat             
    port(.19.):=255;
    port(.19.):=192;
    valg:=port(.17.);
      if valg =   0 then tilstand := 13;
      if valg =  64 then tilstand := 12;
      if valg = 128 then tilstand :=  1;
      if valg = 192 then tilstand :=  0;
    flyt(tilstand);
    if keypress then read(kbd,ch); 
  until ch=' ';
  gotoxy(1,1);write(clrhom);
end.
(*-----------------------------------------*)
«eof»