Re: programation

Page principale

Répondre à ce message
Auteur: Manu Rouat
Date:  
À: guilde
Sujet: Re: programation
Tim Walker wrote:
>
> smallProgram = TEXT
> largeprogram = TEXT
>
> PROC tryItAndSee(smallProgram)
> BEGIN
>         UNTIL CORRECT
>                 DO
>                         WRITE(smallProgram)
>                         TEST(smallProgram)
>                 DONE
>         RETURN HAPPY
> END

>
> PROC happtTodoSomeMore(Program):BOOLEAN
> FUN = 100
> BEGIN
>         UNTIL CORRECT
>                 DO
>                         WRITE(largeProgram)
>                         TEST(largeProgram)
>                         FUN = FUN - 1
>                 DONE

>
>         IF FUN <= 10 THEN
>                 RETURN FALSE
>         ELSE
>                 RETURN TRUE
>         END IF
> END

>
> MAIN Program()
> BEGIN
>
>         tryItAndSee(smallProgram)

>
>         WHILE happyToDoSomeMore(largeProgram)= TRUE
>                 CONTINUE
>         ELSE
>                 STOP
> END



Y'a un bug.... dans la grande tradition du logiciel libre, voici un patch:


--- prog.orig   Fri Apr  2 19:36:39 1999
+++ prog        Fri Apr  2 19:40:31 1999
@@ -32,12 +32,24 @@
 BEGIN
        UNTIL CORRECT
                DO
+                       GetDocumentation(void)
                        WRITE(smallProgram)
                        TEST(smallProgram)
                DONE
        RETURN HAPPY
 END 


+
+PROC GetDocumentation(void)
+BEGIN
+       UNTIL UNDERSTOOD
+               DO
+                       READTHEFUCKINGMANUAL
+                       READTHEFUCKINGMANUAL
+                       READTHEFUCKINGMANUAL
+               DONE
+       RETURN 
+END


PROC happtTodoSomeMore(Program):BOOLEAN
FUN = 100




manu