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

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

!7

static JTable table;
sS listName, guessesList, confirmedList;

p-subst { autoRestart();
  listName = "List => Language";
  guessesList = listName + " | Guesses";
  confirmedList = listName + " | Confirmed";
  makeTable();
  
  addToWindowWithMargin(table, jcenteredline(
    selectedRowCountTableButton(table, jbutton("Confirm", r {
      sendMap(twoElementListsToMap((LL<S>) (L) selectedTableRowsData(table)))
    })),
    selectedRowCountTableButton(table, jbutton("Mark German", r {
      sendMap(replaceValuesWith("german", twoElementListsToMap((LL<S>) (L) selectedTableRowsData(table))))
    })),
    selectedRowCountTableButton(table, jbutton("Mark English", r {
      sendMap(replaceValuesWith("english", twoElementListsToMap((LL<S>) (L) selectedTableRowsData(table))))
    }))));
}

svoid makeTable {
  SS guesses = mechMapCI_leftArrows(guessesList);
  SS confirmed = mechMapCI_leftArrows(confirmedList);
  guesses = mapMinusKeysOfOtherMap(guesses, confirmed);
  
  table = showTable(table, namedMap("List", "Language", mapSortedByValue(guesses)), guessesList);
}

svoid sendMap(SS map) {
  if (!swic(infoBoxAndReturn(botAppendToMechList_uniqCI(confirmedList, formatDoubleLeftArrowMap(map))), "No change")) {
    mechLists_clearCache(); makeTable();
  }
}

download  show line numbers  debug dex   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, 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: 206 / 1769
Version history: 22 change(s)
Referenced in: [show references]

Formerly at http://tinybrain.de/1014242 & http://1014242.tinybrain.de