Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

35
LINES

< > BotCompany Repo | #1006518 // English <-> Computer Language Tests [dev.]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (1389L/10K/32K).

1  
!7
2  
3  
static SS data = litorderedmap(
4  
  "rjmpeccijegweswt mqxvooyvssenlrzh", "I am your father",
5  
  "rjmpeccijegweswt xuppnisnjrerjrcq", "I am your mother",
6  
);
7  
8  
p {
9  
  int tests = 0;
10  
  for (S s : keys(data)) {
11  
    S e = data.get(s);
12  
    assertEquals(s, fromEnglish(e));
13  
    assertEqualsIC(e, toEnglish(s));
14  
    tests += 2;
15  
  }
16  
  print("OK (" + n(tests, "tests") + ")");
17  
}
18  
19  
static S fromEnglish(S s) {
20  
  new Matches m;
21  
  if "i am your ..."
22  
    ret "rjmpeccijegweswt " + fromEnglish($1);
23  
  if "father" ret "mqxvooyvssenlrzh";
24  
  if "mother" ret "xuppnisnjrerjrcq";
25  
  ret s;
26  
}
27  
28  
static S toEnglish(S s) {
29  
  new Matches m;
30  
  if "rjmpeccijegweswt ..."
31  
    ret "I am your " + toEnglish($1);
32  
  if "mqxvooyvssenlrzh" ret "father";
33  
  if "xuppnisnjrerjrcq" ret "mother";
34  
  ret s;
35  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1006518
Snippet name: English <-> Computer Language Tests [dev.]
Eternal ID of this version: #1006518/1
Text MD5: 3f2acf34a07e968412d05f2cfc58bf33
Transpilation MD5: 6e63888eb669925743aed79b24fb488d
Author: stefan
Category: javax / a.i.
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-01-13 18:28:33
Source code size: 799 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 523 / 606
Referenced in: [show references]