aboutsummaryrefslogtreecommitdiffstats
path: root/OLD/csci1913/Java/lab13_strap012.java
diff options
context:
space:
mode:
authorMatt Strapp <matt@mattstrapp.net>2022-05-24 11:18:46 -0500
committerMatt Strapp <matt@mattstrapp.net>2022-05-24 11:19:55 -0500
commit7a73162607544204032aa66cce755daf21edebda (patch)
tree58578e01f15f34a855d99c32898db9d7a1603e67 /OLD/csci1913/Java/lab13_strap012.java
parentdo some stuff (diff)
downloadhomework-7a73162607544204032aa66cce755daf21edebda.tar
homework-7a73162607544204032aa66cce755daf21edebda.tar.gz
homework-7a73162607544204032aa66cce755daf21edebda.tar.bz2
homework-7a73162607544204032aa66cce755daf21edebda.tar.lz
homework-7a73162607544204032aa66cce755daf21edebda.tar.xz
homework-7a73162607544204032aa66cce755daf21edebda.tar.zst
homework-7a73162607544204032aa66cce755daf21edebda.zip
Graduate
Signed-off-by: Matt Strapp <matt@mattstrapp.net>
Diffstat (limited to 'OLD/csci1913/Java/lab13_strap012.java')
-rw-r--r--OLD/csci1913/Java/lab13_strap012.java31
1 files changed, 0 insertions, 31 deletions
diff --git a/OLD/csci1913/Java/lab13_strap012.java b/OLD/csci1913/Java/lab13_strap012.java
deleted file mode 100644
index 8645a98..0000000
--- a/OLD/csci1913/Java/lab13_strap012.java
+++ /dev/null
@@ -1,31 +0,0 @@
-class Test
-{
- private static final String [] reserved =
- { "and",
- "begin",
- "define",
- "do",
- "else",
- "end",
- "if",
- "not",
- "or",
- "return",
- "then",
- "while" };
-
- private static int hash(String name)
- {
- return ((name.charAt(0) + name.charAt(name.length()-1)) * name.length()) % 255;
- }
-
- public static void main(String [] args)
- {
- for (int index = 0; index < reserved.length ; index += 1)
- {
- System.out.print("h(\"" + reserved[index] + "\") = ");
- System.out.print(hash(reserved[index]));
- System.out.println();
- }
- }
-} \ No newline at end of file