.dsy:it. Pages (25): « First ... « 18 19 20 21 [22] 23 24 25 »
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 vergadivina on 04-06-2006 13:57:

provo a modificarla per la millesima volta...leggendo i commenti passati l' errore poteva essere o nell' assign o nella declare ma il fatto è ke proprio non riesco a capire cm correggerla!!! Consigli???


Posted by soak on 04-06-2006 13:59:

posta il run() di declare..


Posted by vergadivina on 04-06-2006 14:01:

public void run() throws ExistingVariableException {
if(state.containsKey(name))
throw new ExistingVariableException(name);
else
state.put(name,Integer.valueOf("0"));
}


Posted by soak on 04-06-2006 14:07:

prova così:

state.put(name, new Integer(0));


Posted by *°§_-??? on 04-06-2006 14:10:

Originally posted by Drowne
toglimi una curiosità...

da che toString viene fuori "L5: JUMP L3:" ?


L'etichetta L5 è generata dal Loop che è scritto prima e serve appunto per permetterne l'uscita quando la condition diviene false, il Jump è invece generato dalla Selection in cui si trova tutto questo e che dispone come ifStatement il Loop di cui sopra.


Posted by vergadivina on 04-06-2006 14:11:

Bella ke non cambia niente nemmeno così...ah ah ah ...ora sì ke spacco giù tutto!!!


Posted by Drowne on 04-06-2006 14:14:

Originally posted by *°§_-???
L'etichetta L5 è generata dal Loop che è scritto prima e serve appunto per permetterne l'uscita quando la condition diviene false, il Jump è invece generato dalla Selection in cui si trova tutto questo e che dispone come ifStatement il Loop di cui sopra.


Grazie mille.

Ho modificato il sistema d'identazione...

ora identa tutto correttamente, ma devo riscrivere le etichette.

mi metto a lavoro :D


Posted by soak on 04-06-2006 14:15:

prova con un esorcismo :-D


Posted by teolino85 on 04-06-2006 14:17:

Originally posted by Pulcina
Sul sito è scritto consegna per il 06 pero se tu vedi la traccia del progetto c'è scritto entro 05 mezza notte il che vuol dire che Mereghetti ha detto che è per il 06 perché mezzanotte del 05 la data cambia


m...questo si ke è semplice come pensiero :cool:


Posted by Drowne on 04-06-2006 14:22:

qualcuno conosce un buon muratore? Sto buttando giù un muro a craniate...

code:
DECLARE a DECLARE b LOAD 7 STORE a LOAD a LOAD 0 GT NOT JZERO L1 Print ''a must be greater than zero.'' JUMP L2 L1: LOAD -1 STORE b LOAD b LOAD 0 GT JZERO L3 L2: LOAD b LOAD 0 EQN LOAD b LOAD 0 GT OR JZERO L5 LOAD -1 STORE b JUMP L2 L3: JUMP L5 L4: Print ''b must be greater than zero.'' LOAD 7 STORE b L5: DECLARE ab LOAD a STORE ab L6: LOAD b LOAD 0 GT JZERO L7 LOAD ab LOAD a ADD STORE ab LOAD b LOAD 1 SUB STORE b JUMP L6 L7: LOAD ab PRINT L8: b must be greater than zero. 56


Posted by *°§_-??? on 04-06-2006 14:25:

Originally posted by vergadivina
Bella ke non cambia niente nemmeno così...ah ah ah ...ora sì ke spacco giù tutto!!!


So che probabilmente non è di nessun aiuto, ma forse devi rivedere la dichiarazione dell'hashtable... ricordati che deve essere accessibile alle altre classi.

Per altro cmq l'idea dell'esorcismo non mi sembra male, ma se fai uno stacco e poi lo riguardi magari noti che è un errore stupidissimo che non notavi neanche.


Posted by *°§_-??? on 04-06-2006 14:33:

Originally posted by Drowne
qualcuno conosce un buon muratore? Sto buttando giù un muro a craniate...

code:
DECLARE a DECLARE b LOAD 7 STORE a LOAD a LOAD 0 GT NOT JZERO L1 Print ''a must be greater than zero.'' JUMP L2 L1: LOAD -1 STORE b LOAD b LOAD 0 GT JZERO L3 L2: LOAD b LOAD 0 EQN LOAD b LOAD 0 GT OR JZERO L5 LOAD -1 STORE b JUMP L2 L3: JUMP L5 L4: Print ''b must be greater than zero.'' LOAD 7 STORE b L5: DECLARE ab LOAD a STORE ab L6: LOAD b LOAD 0 GT JZERO L7 LOAD ab LOAD a ADD STORE ab LOAD b LOAD 1 SUB STORE b JUMP L6 L7: LOAD ab PRINT L8: b must be greater than zero. 56


Ma in quale toString chiedi di incrementare le variabili delle etichette??


Posted by violence!jack on 04-06-2006 15:11:

Selection e Loop....ora provo a fare qualcosa anke su sequence....magari se fai incrementare l'etichetta in sequence non ti devi fare lo sbatti di farlo in selection....provo e ti dico...

__________________
"Il software è come il sesso, è migliore quando è libero." ...Linus Torvalds (1969)


Posted by Drowne on 04-06-2006 15:26:

Allora...

tutti i Lx: .........

fanno riferimento ad una int x dichiarata protected static in statement ed inizializzata a 0.

ogni volta che stampa Lx: .........

in realtà ritorna

"L"+ (++x) + ":"

per quanto riguarda invece JUMP e JZERO:

in Selection:

"JZERO L"+ ++y
ifStatement
"JUMP L"+ ++y
"L"+ ++x +":"
elseStatement
"L"+ ++x +":"

quelle in grassetto sono i JUMP ed i JZERO da considerare, gli incrementi NON in grassetto sono per le etichette, non per i salti... come detto prima.

Mentre Loop:

"L"+ ++x +":"
condition
JZERO L"+ (++y+1)
body
"JUMP L"+ y
"L"+ ++x +":"


Posted by violence!jack on 04-06-2006 16:00:

La y la inizializzi a zero in selection? o anke quella in statement?....

__________________
"Il software è come il sesso, è migliore quando è libero." ...Linus Torvalds (1969)


All times are GMT. The time now is 00:30. Pages (25): « First ... « 18 19 20 21 [22] 23 24 25 »
Show all 374 posts from this thread on one page

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