Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;estructuras
- (define-struct pokemon(ID nombre estadisticas generacion legendario))
- (define-struct estadisticas(HP atq dfn atq-especial dfn-especial velocidad))
- ;carga de datos
- ;contrato:lista de string -> lista de estructura
- (define(cargar-pokemon Ubicacion)
- (local
- (
- (define lista(read-csv-file Ubicacion))
- )
- (transformar-estructura lista)))
- (define (transformar-estructura lista)
- (cond
- [(empty? lista)empty]
- [else (cons (make-pokemon(string->number (first(rest(first lista)))))
- (first(rest (rest(first lista))))
- (first(rest(rest(rest(first lista)))))
- (string->number(first(rest(rest(rest(rest(first lista)))))))
- (if(String=? (First (rest (rest (rest (rest (rest (rest (rest (rest ( rest (Rest (rest (rest ( first lista)))))))))))
- "False" )#false #true))))
- (transformar-estructura(rest lista)))]
- ))
- (define lst-pokemon(cargar-pokemon "data/pokemon.cvs"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement