.dsy:it. Pages (25): « First ... « 9 10 11 12 [13] 14 15 16 17 » ... Last »
Show 150 posts per page

.dsy:it. (http://www.dsy.it/forum/)
- Fondamenti di architettura e programmazione (http://www.dsy.it/forum/forumdisplay.php?forumid=234)
-- [Progetto] 15/05/2006 (http://www.dsy.it/forum/showthread.php?threadid=25535)


Posted by soak on 02-06-2006 10:36:

AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARR
RGGGHHH !!!


Posted by Drowne on 02-06-2006 10:43:

nel senso che non sappiamo dove metterle o cosa?


Posted by soak on 02-06-2006 10:50:

nel senso che io non c'ho capito un cazzo!:x
non so dove implementarle e non so come..


Posted by Drowne on 02-06-2006 11:07:

io ho fatto cosi:

JZERO Lx
condition.toString
ifStatement.toString
JUMP Ly
Lx: elsestatement.tostring
Ly:

Ma sto avendo dubbi che non sia:

condition.toString
JZERO Lx
ifStatement.toString
JUMP Ly
Lx: elsestatement.tostring
Ly:


Posted by soak on 02-06-2006 11:08:

EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
EH!!!!???

...ma io sono calmo..:lol::cry:..cmq io ora mi metto a fare la documentazione..le etichette le farò a caso! perchè tanto secondo me non lo sa neanche il profe come vuole che si faciano!!! non perchè è un incompetente intendiamoci!


Posted by soak on 02-06-2006 11:09:

si meglio la seconda secondo me


Posted by Drowne on 02-06-2006 11:26:

sono a questo per il momento:

code:
D a D b L 7 S a L a L 0 GT NOT JZERO L1 Print ''b must be greater than zero.'' JUMP L2 L1: L -1 S b L b L 0 GT JZERO L3 L b L 0 EQN L b L 0 GT OR L -1 S b JUMP L4 L2: Print ''a must be greater than zero.'' L 7 S b L3: D ab L a S ab L b L 0 GT L ab L a ADD S ab L b L 1 SUB S b L ab PRINT L4: a must be greater than zero. ab


chi vuol capire capisca :D

in effetti cosi è come diceva zyx prima :D

La consegna è stata posticipata al 6/6, beh è già qualcosa dai :D


Posted by soak on 02-06-2006 11:38:

..ah beh! :uhmehehe::ignore: ..un giorno in più!

a me termina con:
-------------------------------------
b must be greater than zero.
56
-------------------------------------
..dipende dal main() che si usa a quanto pare..drowne ma le etichette e i salti ci sono tutti nel tuo output? come hai fatto a piazzare le etichette?


Posted by Drowne on 02-06-2006 11:41:

le etichette le piazzi nel toString di Selection... come ti ho detto prima fai tornare questo:

code:
condition.toString JZERO Lx ifStatement.toString JUMP Ly Lx: elsestatement.tostring Ly:


con i vari \n, il tutto in una variabile String

ma ho un altro dubbio...

l'ultima etichetta punta alla fine del prog... non vorrei che il prof volesse una cosa del tipo L4: PRINT come finale...


Posted by Drowne on 02-06-2006 11:42:

cmq ora prendo il Program.java dell'ultimo pdf uscito e lo ricopio. Poi lo posto qua cosi non abbiamo dubbi :D


Posted by marcuss884 on 02-06-2006 11:48:

Come dice il prof saro' uno dei tanti ignoranti in italiano, ma cosa vuol dire quando dice nel testo del progetto:

"[...]compressi in un archivio di tipo ZIP che estragga i
file nella directory in cui si trova l’archivio stesso.."

Interpretazioni che abbbiano senso??


Posted by Drowne on 02-06-2006 11:52:

in pratica se tu zippi la cartella intera, quando lui ( o il suo script ) lo decomprimono, creano anche la cartella in cui mettere i file .java che gli hai dato. Questo è sbagliato.

Devi comprimere solo i file, ne più ne meno.

cmq sia ora a me finisce con:

code:
b must be greater than zero. ab


quell'ab penso sia colpa mia, ora vedo di sistemarlo...

il PROGRAM.JAVA che è nel file testo-jun06.pdf è questo:

code:
import java.util.Hashtable; public class Program { public static Hashtable state = new Hashtable(); public static void main(String args[]) { try { Declare d0 = new Declare("a"); Declare d1 = new Declare("b"); ReadVariable ra = new ReadVariable("a"); ReadVariable rb = new ReadVariable("b"); Constant zero = new Constant(0); Constant seven = new Constant(7); Assign a0 = new Assign("a", seven); Assign a1 = new Assign("b", new Constant(-1)); PrintString msg1 = new PrintString("a must be greater than zero."); PrintString msg2 = new PrintString("b must be greater than zero."); Loop l1 = new Loop( new Or( new Equal(rb, zero), new GreaterThan(rb, zero) ), a1); Statement sts[] = new Statement[4]; sts[0] = d0; sts[1] = d1; sts[2] = a0; Sequence ss0 = new Sequence(new Statement[]{msg2, new Assign("b", seven)}); Selection s1 = new Selection(new GreaterThan(rb, zero), l1, ss0); Declare d2 = new Declare("ab"); a1 = new Assign("ab", ra); Assign a3 = new Assign("ab", new Add(new ReadVariable("ab"), ra)); Assign a2 = new Assign("b", new Subtract(rb, new Constant(1))); l1 = new Loop( new GreaterThan(rb, zero), new Sequence(new Statement[]{a3, a2}) ); Sequence ss1 = new Sequence( new Statement[]{ new Assign("b", new Constant(-1)), s1, d2, a1, l1, new PrintExpression(new ReadVariable("ab")) } ); sts[3] = new Selection(new Not(new GreaterThan(ra, zero)), msg1, ss1); ss1 = new Sequence(sts); System.out.println(ss1); ss1.run(); } catch ( ExecutionException e ) { e.printStackTrace(); } } }


Posted by marcuss884 on 02-06-2006 12:07:

Drowne scusa ma nn t ho capito....
Cioè seleziono i .java e li inserisco in un archivio. tutto qui?

Cmq al posto di ab ti deve stampare il risultato finale, che nn è altro che il risultato dell'invocazione del metodo run() di PrintExpression. in parole povere, il famoso 56


Posted by Drowne on 02-06-2006 12:11:

il run di PrintExpression :D Grazie mille ^_^

ma se faccio:

System.out.println(toBeEvaluated);

mi stampa ab...

--------

selezioni i file .java e li aggiungi si ^_^ nulla di più facile. La preoccupazione del prof deriva dal fatto che se aggiungi tutta la cartella dove sono tenuti i file, il suo script non va.


Posted by Drowne on 02-06-2006 12:15:

bastava mettere l'eval :D


All times are GMT. The time now is 22:38. Pages (25): « First ... « 9 10 11 12 [13] 14 15 16 17 » ... Last »
Show all 374 posts from this thread on one page

Powered by: vBulletin Version 2.3.1
Copyright © Jelsoft Enterprises Limited 2000 - 2002.