Fret calculator


program trastes;
uses crt;
var scaling_factor,distance,scale,localizacion:real;
num_frets,f:shortint;
parametro:string;

function mensaje(m : string):string;
begin
gotoxy(1,24);
write(m);
end;

function pausecero(p : string) : string;
begin
mensaje(p);
repeat
until keypressed;
end;

function repetir:boolean;
var a : char;
begin
gotoxy(1,24);
write('Realizar otro calculo? (S/N) ');
a:=readkey;
if (a=char(83)) or (a=char(115)) then
repetir:=true
else begin
repetir:=false
end;
end;

procedure presentacion;
begin
window(1,1,80,25);
clrscr;
gotoxy(20,5);
writeln('ANOTHER FRET CALCULATOR');
writeln;
writeln('Calculadora para el distanciado de trastes en instrumentos de cuerda');
writeln('para un maximo de 33 trastes, que ya esta bien ;) ');
writeln;
writeln('Las medidas tanto para el tiro como para las distancias de la cejuela o el');
writeln('traste cero a los demas trastes van en milimetros');
writeln;
writeln;
writeln(' kir (kir@sdf-eu.org) 2010');
writeln;writeln;
end;

procedure calculos;
begin
repeat
window(1,1,80,24);
clrscr;
gotoxy(1,1);
write('Introducir el tiro en mm: ');
read(scale);
repeat
gotoxy(1,2);
write('Introducir numero de trastes: ');
read(num_frets);
if num_frets > 33 then
begin
gotoxy(1,23);
writeln('El numero maximo es de 33 trastes');
end;
until num_frets < 34;
clrscr;
writeln('Tiro:', scale:7:0,' mm',' Num. de trastes: ', num_frets);
writeln;
writeln('Traste Distancia a la cejuela');
writeln('------------------------------');

distance:=0;
for f := 1 to num_frets do
begin
localizacion:=scale-distance;
scaling_factor:=localizacion/17.817;
distance:=distance+scaling_factor;
writeln(f,' .... ',distance:7:2);
if f=18 then
begin
window(40,4,79,23);
gotoxy(41,5);
writeln(f,' .... ',distance:7:2);
end;
end;
until repetir=false;
end;


begin

parametro :=paramstr(1);

if parametro='-h' then
begin
pausecero('No hay ayuda disponible');
end;
{ presentacion;}
calculos;
window(1,1,80,24);
clrscr;
presentacion;

end.


Descargar el ejecutable para Linux.
Descargar el ejecutable para Windows

No hay comentarios: