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

36
LINES

< > BotCompany Repo | #1014242 // List => Language | Guessing table

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

Download Jar. Uses 3874K of libraries. Click here for Pure Java version (8841L/63K).

1  
!7
2  
3  
static JTable table;
4  
sS listName, guessesList, confirmedList;
5  
6  
p-subst { autoRestart();
7  
  listName = "List => Language";
8  
  guessesList = listName + " | Guesses";
9  
  confirmedList = listName + " | Confirmed";
10  
  makeTable();
11  
  
12  
  addToWindowWithMargin(table, jcenteredline(
13  
    selectedRowCountTableButton(table, jbutton("Confirm", r {
14  
      sendMap(twoElementListsToMap((LL<S>) (L) selectedTableRowsData(table)))
15  
    })),
16  
    selectedRowCountTableButton(table, jbutton("Mark German", r {
17  
      sendMap(replaceValuesWith("german", twoElementListsToMap((LL<S>) (L) selectedTableRowsData(table))))
18  
    })),
19  
    selectedRowCountTableButton(table, jbutton("Mark English", r {
20  
      sendMap(replaceValuesWith("english", twoElementListsToMap((LL<S>) (L) selectedTableRowsData(table))))
21  
    }))));
22  
}
23  
24  
svoid makeTable {
25  
  SS guesses = mechMapCI_leftArrows(guessesList);
26  
  SS confirmed = mechMapCI_leftArrows(confirmedList);
27  
  guesses = mapMinusKeysOfOtherMap(guesses, confirmed);
28  
  
29  
  table = showTable(table, namedMap("List", "Language", mapSortedByValue(guesses)), guessesList);
30  
}
31  
32  
svoid sendMap(SS map) {
33  
  if (!swic(infoBoxAndReturn(botAppendToMechList_uniqCI(confirmedList, formatDoubleLeftArrowMap(map))), "No change")) {
34  
    mechLists_clearCache(); makeTable();
35  
  }
36  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1014242
Snippet name: List => Language | Guessing table
Eternal ID of this version: #1014242/23
Text MD5: 7252a8c75bd27ecbb125d18227ef61b3
Transpilation MD5: a6d8a66a01d43d90991249d594078e50
Author: stefan
Category: javax / a.i.
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-04-20 13:16:00
Source code size: 1302 bytes / 36 lines
Pitched / IR pitched: No / No
Views / Downloads: 336 / 2324
Version history: 22 change(s)
Referenced in: [show references]