diff options
author | elioat <elioat@tilde.institute> | 2022-12-02 21:10:02 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2022-12-02 21:10:02 -0500 |
commit | 4c22154d2bf972bf8ba503de7846441dcfd9e97c (patch) | |
tree | d925711f35c8f7ff752216671ed74ad863ce514e /src | |
parent | 4221c7ed8821c058988e7c45e5587fd46c8056f2 (diff) | |
download | december-2022-4c22154d2bf972bf8ba503de7846441dcfd9e97c.tar.gz |
added a function to make reading hash tables easier
Diffstat (limited to 'src')
-rw-r--r-- | src/pokedex.rkt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/pokedex.rkt b/src/pokedex.rkt index cc2d9d0..af7f1ff 100644 --- a/src/pokedex.rkt +++ b/src/pokedex.rkt @@ -37,8 +37,14 @@ (hash-set! entry-data "types" (hash-ref poke-data 'types)) entry-data)) -(dex-entry 12) ;; QUESTION: would this all be easier to handle if it were a vector or list instead of a hash table? +; (dex-entry 12) ;; QUESTION: would this all be easier to handle if it were a vector or list instead of a hash table? ;; TOMORROW I'll start to figure out how to present this data -(hash-ref (dex-entry 12) "stats") \ No newline at end of file +(define (inspector h) + "display the contents of a hash table for human eyeballs" + (hash-for-each h + (lambda (k v) + (display (~a "key: " k ", value: " v "\n"))))) + +(inspector (dex-entry 5)) \ No newline at end of file |