Ver Mensaje Individual
  #7  
Antiguo 10-04-2007
Avatar de dec
dec dec is offline
Moderador
 
Registrado: dic 2004
Ubicación: Alcobendas, Madrid, España
Posts: 13.141
Reputación: 36
dec Tiene un aura espectaculardec Tiene un aura espectacular
Código Delphi [-]
program WhatOS;

{$APPTYPE CONSOLE}

uses
  SysUtils;

const
  GNU_LIBERTY_VALUE = 10;

var
  input: string;
  dummy: integer;

procedure Main();
begin
  Writeln('');
  Writeln('Ideal Operating System v1.0 (CopyRights 2007 DEC)');
  Writeln('-------------------------------------------------');
  Writeln('');
  WriteLn('What is your liberty level? (0 to 10) Press S and ENTER to exit');
  Writeln('');
  while(input = '')do
  begin
    ReadLn(input);
    input := Trim(input);
    if(LowerCase(input) = 's') then
    begin
      Writeln('');
      Writeln('');
      Writeln('Have a good day!');
      Sleep(2000);
      Exit;
    end;
    if (Length(input) <= 2) and TryStrToInt(input, dummy) then
    begin
      if(dummy < 10) then
      begin
        Writeln('');
        Writeln('OMG! Computing result... stay alive...');
        Sleep(5000);
      end;
      Writeln('');
      Writeln('');
      if (dummy >= GNU_LIBERTY_VALUE) then
        Writeln('Ok! Your ideal operating system is GNU/Linux')
      else
        Writeln('Ok! Your ideal operating system is Microsoft Windows');
      Writeln('');  
    end
    else
    begin
      Writeln('');
      Writeln('Wrong input... try again...');
      Writeln('');
      input := '';
    end;
  end; // while
  Writeln('');
  Writeln('Thanks for use this program. Press ENTER to exit');
  ReadLn;
end;

begin
  Main();
end.
Archivos Adjuntos
Tipo de Archivo: zip WhatOS.zip (24,8 KB, 8 visitas)
__________________
David Esperalta
www.decsoftutils.com

Última edición por dec fecha: 10-04-2007 a las 08:09:50.
Responder Con Cita