![]() |
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)
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???
posta il run() di declare..
public void run() throws ExistingVariableException {
if(state.containsKey(name))
throw new ExistingVariableException(name);
else
state.put(name,Integer.valueOf("0"));
}
prova così:
state.put(name, new Integer(0));
Originally posted by Drowne
toglimi una curiosità...
da che toString viene fuori "L5: JUMP L3:" ?
Bella ke non cambia niente nemmeno così...ah ah ah ...ora sì ke spacco giù tutto!!!
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.
prova con un esorcismo ![]()
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
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
Originally posted by vergadivina
Bella ke non cambia niente nemmeno così...ah ah ah ...ora sì ke spacco giù tutto!!!
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
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)
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 +":"
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.