forked from brownl13/cipher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ufun.java
38 lines (28 loc) · 915 Bytes
/
ufun.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class ufun{
public final ArrayList<Integer> uZcon(String c){
c = c.toLowerCase(); //to lower
ArrayList n = new ArrayList<Integer>();
char[] cArray = c.toCharArray(); // to char array
//loop through char array and convert letters into #
for(int i = 0; i < cArray.length; i++){
//conversion equation and add to arraylist
n.add((int)cArray[i] - (int)'a' + 1);
}
return n;
}
public final ArrayList<Integer> uOcon(String c){
c = c.toLowerCase(); //to lower
ArrayList n = new ArrayList<Integer>();
char[] cArray = c.toCharArray(); // to char array
//loop through char array and convert letters into #
for(int i = 0; i < cArray.length; i++){
//conversion equation and add to arraylist
n.add((int)cArray[i] - (int)'a');
}
return n;
}
}