Advertisement
biasorter

bias sorter

Jun 25th, 2018
64,961
3
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.80 KB | None | 3 0
  1. <!DOCTYPE html>
  2. <script>var __pbpa = true;</script><script>var translated_warning_string = 'Warning: Never enter your Tumblr password unless \u201chttps://www.tumblr.com/login\u201d\x0ais the address in your web browser.\x0a\x0aYou should also see a green \u201cTumblr, Inc.\u201d identification in the address bar.\x0a\x0aSpammers and other bad guys use fake forms to steal passwords.\x0a\x0aTumblr will never ask you to log in from a user\u2019s blog.\x0a\x0aAre you absolutely sure you want to continue?';</script><script type="text/javascript" language="javascript" src="http://assets.tumblr.com/assets/scripts/pre_tumblelog.js?_v=66ac555bc5745ebe20abdae7cbc40704"></script>
  3. <!doctype HTML>
  4. <link rel="shortcut icon" href="http://sv.tinypic.com?ref=qq68e9">
  5.  
  6. <html>
  7.  
  8. <head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# blog: http://ogp.me/ns/blog#">
  9.  
  10. <meta http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
  11.  
  12. <meta http-equiv="Content-Style-Type" content="text/css">
  13.  
  14. <meta http-equiv="Content-Script-Type" content="text/javascript">
  15.  
  16. <script type="text/javascript">
  17.  
  18. <!--
  19.  
  20. var namMember = new Array(
  21.  
  22. "option 1",
  23.  
  24. "option 2",
  25.  
  26. "option 3",
  27.  
  28. "option 4",
  29.  
  30. "option 5"
  31.  
  32.  
  33. );
  34.  
  35.  
  36.  
  37. //*********************************************************
  38.  
  39.  
  40.  
  41. var lstMember = new Array();
  42.  
  43. var parent = new Array();
  44.  
  45. var equal = new Array();
  46.  
  47. var rec = new Array();
  48.  
  49. var cmp1,cmp2;
  50.  
  51. var head1,head2;
  52.  
  53. var nrec;
  54.  
  55.  
  56.  
  57. var numQuestion;
  58.  
  59. var totalSize;
  60.  
  61. var finishSize;
  62.  
  63. var finishFlag;
  64.  
  65.  
  66.  
  67. //The initialization of the variable+++++++++++++++++++++++++++++++++++++++++++++
  68.  
  69. function initList(){
  70.  
  71. var n = 0;
  72.  
  73. var mid;
  74.  
  75. var i;
  76.  
  77.  
  78.  
  79. //The sequence that you should sort
  80.  
  81. lstMember[n] = new Array();
  82.  
  83. for (i=0; i<namMember.length; i++) {
  84.  
  85. lstMember[n][i] = i;
  86.  
  87. }
  88.  
  89. parent[n] = -1;
  90.  
  91. totalSize = 0;
  92.  
  93. n++;
  94.  
  95.  
  96.  
  97. for (i=0; i<lstMember.length; i++) {
  98.  
  99. //And element divides it in two/more than two
  100.  
  101. //Increase divided sequence of last in first member
  102.  
  103. if(lstMember[i].length>=2) {
  104.  
  105. mid = Math.ceil(lstMember[i].length/2);
  106.  
  107. lstMember[n] = new Array();
  108.  
  109. lstMember[n] = lstMember[i].slice(0,mid);
  110.  
  111. totalSize += lstMember[n].length;
  112.  
  113. parent[n] = i;
  114.  
  115. n++;
  116.  
  117. lstMember[n] = new Array();
  118.  
  119. lstMember[n] = lstMember[i].slice(mid,lstMember[i].length);
  120.  
  121. totalSize += lstMember[n].length;
  122.  
  123. parent[n] = i;
  124.  
  125. n++;
  126.  
  127. }
  128.  
  129. }
  130.  
  131.  
  132.  
  133. //Preserve this sequence
  134.  
  135. for (i=0; i<namMember.length; i++) {
  136.  
  137. rec[i] = 0;
  138.  
  139. }
  140.  
  141. nrec = 0;
  142.  
  143.  
  144.  
  145. //List that keeps your results
  146.  
  147. //Value of link initial
  148.  
  149. // Value of link initial
  150.  
  151. for (i=0; i<=namMember.length; i++) {
  152.  
  153. equal[i] = -1;
  154.  
  155. }
  156.  
  157.  
  158.  
  159. cmp1 = lstMember.length-2;
  160.  
  161. cmp2 = lstMember.length-1;
  162.  
  163. head1 = 0;
  164.  
  165. head2 = 0;
  166.  
  167. numQuestion = 1;
  168.  
  169. finishSize = 0;
  170.  
  171. finishFlag = 0;
  172.  
  173. }
  174.  
  175.  
  176.  
  177. //&#12522;&#12473;&#12488;&#12398;&#12477;&#12540;&#12488;+++++++++++++++++++++++++++++++++++++++++++
  178.  
  179. //flag&#65306;Don't know characters
  180.  
  181. // -1&#65306;Chose the left
  182.  
  183. // 0&#65306;Tie
  184.  
  185. // 1&#65306;Chose the right
  186.  
  187. function sortList(flag){
  188.  
  189. var i;
  190.  
  191. var str;
  192.  
  193.  
  194.  
  195. //rec preservation
  196.  
  197. if (flag<0) {
  198.  
  199. rec[nrec] = lstMember[cmp1][head1];
  200.  
  201. head1++;
  202.  
  203. nrec++;
  204.  
  205. finishSize++;
  206.  
  207. while (equal[rec[nrec-1]]!=-1) {
  208.  
  209. rec[nrec] = lstMember[cmp1][head1];
  210.  
  211. head1++;
  212.  
  213. nrec++;
  214.  
  215. finishSize++;
  216.  
  217. }
  218.  
  219. }
  220.  
  221. else if (flag>0) {
  222.  
  223. rec[nrec] = lstMember[cmp2][head2];
  224.  
  225. head2++;
  226.  
  227. nrec++;
  228.  
  229. finishSize++;
  230.  
  231. while (equal[rec[nrec-1]]!=-1) {
  232.  
  233. rec[nrec] = lstMember[cmp2][head2];
  234.  
  235. head2++;
  236.  
  237. nrec++;
  238.  
  239. finishSize++;
  240.  
  241. }
  242.  
  243. }
  244.  
  245. else {
  246.  
  247. rec[nrec] = lstMember[cmp1][head1];
  248.  
  249. head1++;
  250.  
  251. nrec++;
  252.  
  253. finishSize++;
  254.  
  255. while (equal[rec[nrec-1]]!=-1) {
  256.  
  257. rec[nrec] = lstMember[cmp1][head1];
  258.  
  259. head1++;
  260.  
  261. nrec++;
  262.  
  263. finishSize++;
  264.  
  265. }
  266.  
  267. equal[rec[nrec-1]] = lstMember[cmp2][head2];
  268.  
  269. rec[nrec] = lstMember[cmp2][head2];
  270.  
  271. head2++;
  272.  
  273. nrec++;
  274.  
  275. finishSize++;
  276.  
  277. while (equal[rec[nrec-1]]!=-1) {
  278.  
  279. rec[nrec] = lstMember[cmp2][head2];
  280.  
  281. head2++;
  282.  
  283. nrec++;
  284.  
  285. finishSize++;
  286.  
  287. }
  288.  
  289. }
  290.  
  291.  
  292.  
  293. //Processing after finishing with one list
  294.  
  295. if (head1<lstMember[cmp1].length && head2==lstMember[cmp2].length) {
  296.  
  297. //List the remainder of cmp2 copies, list cmp1 copies when finished scanning
  298.  
  299. while (head1<lstMember[cmp1].length){
  300.  
  301. rec[nrec] = lstMember[cmp1][head1];
  302.  
  303. head1++;
  304.  
  305. nrec++;
  306.  
  307. finishSize++;
  308.  
  309. }
  310.  
  311. }
  312.  
  313. else if (head1==lstMember[cmp1].length && head2<lstMember[cmp2].length) {
  314.  
  315. //List the remainder of cmp1 copies, list cmp2 copies when finished scanning
  316.  
  317. while (head2<lstMember[cmp2].length){
  318.  
  319. rec[nrec] = lstMember[cmp2][head2];
  320.  
  321. head2++;
  322.  
  323. nrec++;
  324.  
  325. finishSize++;
  326.  
  327. }
  328.  
  329. }
  330.  
  331.  
  332.  
  333. //When it arrives at the end of both lists
  334.  
  335. //Update a pro list
  336.  
  337. if (head1==lstMember[cmp1].length && head2==lstMember[cmp2].length) {
  338.  
  339. for (i=0; i<lstMember[cmp1].length+lstMember[cmp2].length; i++) {
  340.  
  341. lstMember[parent[cmp1]][i] = rec[i];
  342.  
  343. }
  344.  
  345. lstMember.pop();
  346.  
  347. lstMember.pop();
  348.  
  349. cmp1 = cmp1-2;
  350.  
  351. cmp2 = cmp2-2;
  352.  
  353. head1 = 0;
  354.  
  355. head2 = 0;
  356.  
  357.  
  358.  
  359. //Initialize the rec before performing the new comparison
  360.  
  361. if (head1==0 && head2==0) {
  362.  
  363. for (i=0; i<namMember.length; i++) {
  364.  
  365. rec[i] = 0;
  366.  
  367. }
  368.  
  369. nrec = 0;
  370.  
  371. }
  372.  
  373. }
  374.  
  375.  
  376.  
  377. if (cmp1<0) {
  378.  
  379. str = "battle #"+(numQuestion-1)+"<br>"+Math.floor(finishSize*100/totalSize)+"% sorted.";
  380.  
  381. document.getElementById("battleNumber").innerHTML = str;
  382.  
  383.  
  384.  
  385. showResult();
  386.  
  387. finishFlag = 1;
  388.  
  389. }
  390.  
  391. else {
  392.  
  393. showImage();
  394.  
  395. }
  396.  
  397. }
  398.  
  399.  
  400.  
  401. //The results+++++++++++++++++++++++++++++++++++++++++++++++
  402.  
  403. //&#38918;&#20301;=Rank/Grade/Position/Standing/Status
  404.  
  405. //&#21517;&#21069;=Identification term
  406.  
  407. function showResult() {
  408.  
  409. var ranking = 1;
  410.  
  411. var sameRank = 1;
  412.  
  413. var str = "";
  414.  
  415. var i;
  416.  
  417.  
  418.  
  419. str += "<table style=\"width:200px; font-size:18px; line-height:120%; margin-left:auto; margin-right:auto; border:1px solid #000; border-collapse:collapse\" align=\"center\">";
  420.  
  421. str += "<tr><td style=\"color:#ffffff; background-color:#e097d9; text-align:center;\">rank<\/td><td style=\"color:#ffffff; background-color:#e097d9; text-align:center;\">options<\/td><\/tr>";
  422.  
  423.  
  424.  
  425. for (i=0; i<namMember.length; i++) {
  426.  
  427. str += "<tr><td style=\"border:1px solid #000; text-align:center; padding-right:5px;\">"+ranking+"<\/td><td style=\"border:1px solid #000; padding-left:5px;\">"+namMember[lstMember[0][i]]+"<\/td><\/tr>";
  428.  
  429. if (i<namMember.length-1) {
  430.  
  431. if (equal[lstMember[0][i]]==lstMember[0][i+1]) {
  432.  
  433. sameRank++;
  434.  
  435. } else {
  436.  
  437. ranking += sameRank;
  438.  
  439. sameRank = 1;
  440.  
  441. }
  442.  
  443. }
  444.  
  445. }
  446.  
  447. str += "<\/table>";
  448.  
  449.  
  450.  
  451. document.getElementById("resultField").innerHTML = str;
  452.  
  453. }
  454.  
  455.  
  456.  
  457. //Indicates two elements to compare+++++++++++++++++++++++++++++++++++
  458.  
  459. function showImage() {
  460.  
  461. var str0 = "battle #"+numQuestion+"<br>"+Math.floor(finishSize*100/totalSize)+"% sorted.";
  462.  
  463. var str1 = ""+toNameFace(lstMember[cmp1][head1]);
  464.  
  465. var str2 = ""+toNameFace(lstMember[cmp2][head2]);
  466.  
  467.  
  468.  
  469. document.getElementById("battleNumber").innerHTML = str0;
  470.  
  471. document.getElementById("leftField").innerHTML = str1;
  472.  
  473. document.getElementById("rightField").innerHTML = str2;
  474.  
  475.  
  476.  
  477. numQuestion++;
  478.  
  479. }
  480.  
  481.  
  482.  
  483. //Convert numeric value into a name (emoticon)+++++++++++++++++++++++++++++++
  484.  
  485. function toNameFace(n){
  486.  
  487. var str = namMember[n];
  488.  
  489.  
  490.  
  491. /*
  492.  
  493. str += '<br />';
  494.  
  495. switch(n) {
  496.  
  497. //case -1 Because it is a sample, delete it
  498.  
  499. case -1: str+=""; break;
  500.  
  501. }*/
  502.  
  503. return str;
  504.  
  505. }
  506.  
  507. //-->
  508.  
  509. </script>
  510.  
  511. <style type="text/css">
  512.  
  513. <!--
  514.  
  515. #mainTable{
  516.  
  517. font-size: 19px;
  518.  
  519. font-family: 'Times New Roman', serif;
  520.  
  521. text-align: center;
  522.  
  523. vertical-align: middle;
  524.  
  525. width: 410px;
  526.  
  527. margin-left: auto;
  528.  
  529. margin-right: auto;
  530.  
  531. border-collapse: separate;
  532.  
  533. border-spacing: 10px 5px;
  534.  
  535. }
  536.  
  537. #leftField{
  538.  
  539. width: 120px;
  540.  
  541. height: 150px;
  542.  
  543. border: 1px solid #000;
  544.  
  545. cursor: pointer;
  546.  
  547. }
  548.  
  549. #rightField{
  550.  
  551. width: 120px;
  552.  
  553. height: 150px;
  554.  
  555. border: 1px solid #000;
  556.  
  557. cursor: pointer;
  558.  
  559. }
  560.  
  561. .middleField{
  562.  
  563. width: 120px;
  564.  
  565. height: 70px;
  566.  
  567. border: 1px solid #000;
  568.  
  569. cursor: pointer;
  570.  
  571. }
  572.  
  573. a{
  574.  
  575. color: #e097d9;
  576.  
  577. text-decoration : none;
  578.  
  579. }
  580.  
  581. a:hover{
  582.  
  583. color: #8f8f8f;
  584.  
  585. }
  586.  
  587. body {
  588.  
  589. width: 600px;
  590.  
  591. margin: 0 auto;
  592.  
  593. font-family: 'Times New Roman', erif;
  594.  
  595. }
  596.  
  597. -->
  598.  
  599. </style>
  600.  
  601.  
  602. <!-- BEGIN TUMBLR FACEBOOK OPENGRAPH TAGS --><!-- If you'd like to specify your own Open Graph tags, define the og:url and og:title tags in your theme's HTML. --><!-- Read more: http://ogp.me/ --><meta property="fb:app_id" content="48119224995" /><meta property="og:site_name" content="" /><meta property="og:title" content="Not Found" /><meta property="og:url" content="" /><meta property="og:description" content="The URL you requested could not be found." /><meta property="og:determiner" content="a" /><meta property="og:type" content="tumblr-feed:entry" /><meta property="og:image" content="http://assets.tumblr.com/images/og/text_200.png" /><!-- END TUMBLR FACEBOOK OPENGRAPH TAGS -->
  603.  
  604.  
  605. <!-- TWITTER TAGS --><meta charset="utf-8"><meta name="twitter:card" content="summary" /><meta name="twitter:description" content="The URL you requested could not be found." /><meta name="twitter:title" content="Not Found" /><meta name="twitter:url" content="" /><meta name="twitter:site" content="tumblr" /><meta name="twitter:app:name:iphone" content="Tumblr" /><meta name="twitter:app:name:ipad" content="Tumblr" /><meta name="twitter:app:name:googleplay" content="Tumblr" /><meta name="twitter:app:id:iphone" content="305343404" /><meta name="twitter:app:id:ipad" content="305343404" /><meta name="twitter:app:id:googleplay" content="com.tumblr" /><meta name="twitter:app:url:iphone" content="tumblr://x-callback-url/blog?blogName=roosterteethcs&amp;postID=&amp;referrer=twitter-cards" /><meta name="twitter:app:url:ipad" content="tumblr://x-callback-url/blog?blogName=roosterteethcs&amp;postID=&amp;referrer=twitter-cards" /><meta name="twitter:app:url:googleplay" content="tumblr://x-callback-url/blog?blogName=roosterteethcs&amp;postID=&amp;referrer=twitter-cards" />
  606.  
  607. <script src="http://assets.tumblr.com/assets/scripts/tumblelog.js?_v=a9e2d0b0ade5958a1a2a936adf448061"></script>
  608. <meta http-equiv="x-dns-prefetch-control" content="off"/>
  609. </head>
  610. <link href='http://fonts.googleapis.com/css?family=Josefin+Slab:600' rel='stylesheet' type='text/css'>
  611.  
  612. <body text="#000000" bgcolor="#ffffff" link="#e097d9" vlink="#e097d9" alink="#79a2c9">
  613.  
  614.  
  615.  
  616. <p class="instructions">
  617. <center><br /><br />
  618. <b>SORTER NAME</b><br /><br>pick who you like better in each battle to get an accurate list of your<br />favorite members from the group.<br />note: hitting 'no opinion' or 'I like both' frequently will negatively affect your results.<br /><br /></center>
  619.  
  620.  
  621.  
  622. </p>
  623.  
  624.  
  625.  
  626. <table id="mainTable" align="center">
  627.  
  628. <tbody><tr>
  629.  
  630. <td id="battleNumber" colspan="3" style="padding-bottom: 10px;" style="text-align:center;"><b>battle #1<br>0% sorted.</b></td>
  631.  
  632. </tr>
  633.  
  634. <tr>
  635.  
  636. <td id="leftField" onclick="if(finishFlag==0) sortList(-1);" rowspan="2" style="text-align:center;"></td>
  637.  
  638. <td class="middleField" onclick="if(finishFlag==0) sortList(0);" style="text-align:center;">
  639.  
  640. I like both
  641.  
  642. </td>
  643.  
  644. <td id="rightField" onclick="if(finishFlag==0) sortList(1);" rowspan="2"style="text-align:center;"></td>
  645.  
  646. </tr>
  647.  
  648. <tr>
  649.  
  650. <td class="middleField" onclick="if(finishFlag==0) sortList(0);"style="text-align:center;">
  651.  
  652. no opinion
  653.  
  654. </td>
  655.  
  656. </tr>
  657.  
  658. </tbody></table>
  659.  
  660. <br><br>
  661.  
  662. <div id="resultField" style="text-align: center;">
  663.  
  664. <br>
  665.  
  666. </div>
  667.  
  668. <script type="text/javascript">
  669.  
  670. <!--
  671.  
  672. initList();
  673.  
  674. showImage();
  675.  
  676. //-->
  677.  
  678.  
  679. </script>
  680. <p class="other">
  681. <center><small><br /><br />used with permission.<br /><br/><a href="http://biasorter.tumblr.com/">created by biasorter</a>.
  682. </small></center></small>
  683. </p>
  684.  
  685. <!-- BEGIN TUMBLR CODE --><iframe id="tumblr_controls" width="1" height="1" frameborder="0" scrolling="no" style="position:absolute; z-index:2147483647; top:0; right:0; border:0; background-color:transparent; overflow:hidden; " src="http://assets.tumblr.com/assets/html/iframe/o.html?_v=dddebe193046ef922006b33d60687b05#src=http%3A%2F%2Froosterteethcs.tumblr.com%2Fask&amp;lang=en_US&amp;name=roosterteethcs&amp;avatar=http%3A%2F%2Fassets.tumblr.com%2Fimages%2Fdefault_avatar%2Fpyramid_open_64.png&amp;title=rt+character+sorter&amp;url=http%3A%2F%2Froosterteethcs.tumblr.com%2F&amp;page_slide=slide"></iframe><div id="teaser_iframe_container" style="display:none;"><iframe scrolling="no" frameborder="0" src="http://www.tumblr.com/assets/html/iframe/teaser.html?_v=0334cdd0135fa4ea13587cd37c2dcf98#src=http%3A%2F%2Froosterteethcs.tumblr.com%2Fask&amp;lang=en_US&amp;name=roosterteethcs&amp;avatar=http%3A%2F%2Fassets.tumblr.com%2Fimages%2Fdefault_avatar%2Fpyramid_open_64.png&amp;title=rt+character+sorter&amp;url=http%3A%2F%2Froosterteethcs.tumblr.com%2F&amp;page_slide=slide" id="teaser_iframe" width="1" height="1"></iframe></div><!--[if IE]><script type="text/javascript">document.getElementById('tumblr_controls').allowTransparency=true;</script><![endif]--><iframe onload="javascript:this.contentWindow.postMessage(['tick_google_analytics', '/ask?route=404_page'].join(';'), this.src.split('/analytics.html')[0]); COMSCORE = true;this.contentWindow.postMessage('enable_comscore;' + window.location, this.src.split('/analytics.html')[0]);" src="http://assets.tumblr.com/analytics.html?9bbb9e7732da937858cd0531689c20b1" scrolling="no" width="1" height="1" frameborder="0" style="background-color:transparent; overflow:hidden; position:absolute; top:0; left:0 z-index:9999;" id="ga_target"></iframe><script type="text/javascript">
  686. var _qevents = _qevents || [];
  687.  
  688. (function() {
  689. var elem = document.createElement('script');
  690.  
  691. elem.src = (document.location.protocol == "https:" ? "https://secure" : "http://edge") + ".quantserve.com/quant.js";
  692. elem.async = true;
  693. elem.type = "text/javascript";
  694. var scpt = document.getElementsByTagName('script')[0];
  695. scpt.parentNode.insertBefore(elem, scpt);
  696. })();
  697. </script><script type="text/javascript">
  698. _qevents.push( { qacct: 'p-19UtqE8ngoZbM' } );
  699. </script><noscript><div style="display: none;"><img src="//pixel.quantserve.com/pixel/'p-19UtqE8ngoZbM'.gif" height="1" width="1" alt="Quantcast"/></div></noscript><script type="text/javascript">!function(s){s.src='http://www.tumblr.com/impixu?T=1389854658&J=eyJ0eXBlIjoidXJsIiwidXJsIjoiaHR0cDpcL1wvcm9vc3RlcnRlZXRoY3MudHVtYmxyLmNvbVwvYXNrIiwicmVxdHlwZSI6MCwicm91dGUiOiI0MDRfcGFnZSJ9&U=GJPMNFPHIN&K=745811f0e9615242e744b26218c2e56a6c6b184a1315e6c9e9e871a0c242e3ab&R=http%3A%2F%2Froosterteethcs.tumblr.com%2F'.replace(/&R=[^&$]*/,'').concat('&R='+escape(document.referrer)).slice(0,2000).replace(/%.?.?$/,'');}(new Image());</script><noscript><img style="position:absolute;z-index:-3334;top:0px;left:0px;visibility:hidden;" src="http://www.tumblr.com/impixu?T=1389854658&J=eyJ0eXBlIjoidXJsIiwidXJsIjoiaHR0cDpcL1wvcm9vc3RlcnRlZXRoY3MudHVtYmxyLmNvbVwvYXNrIiwicmVxdHlwZSI6MCwicm91dGUiOiI0MDRfcGFnZSIsIm5vc2NyaXB0IjoxfQ==&U=GJPMNFPHIN&K=c7a8ec33be24dcae3b08d0ffc26af0508ef65362a18101b8963123d054b7f79e&R=http%3A%2F%2Froosterteethcs.tumblr.com%2F"></noscript><script type="text/javascript" src="http://l.yimg.com/ss/rapid-3.9.js"></script><script>
  700. (function(YAHOO) {
  701. if (YAHOO) {
  702. YAHOO.i13n.beacon_server = 'nol.yahoo.com';
  703. var keys = { pd:'404_page', _li:0, i_rad:0, i_strm:0 };
  704. YAHOO.rapid = new YAHOO.i13n.Rapid({spaceid:1197719233, oo:1, client_only:1, yql_enabled:false, keys:keys});
  705. }
  706. })(window.YAHOO);
  707. </script><!-- END TUMBLR CODE -->
  708.  
  709. </body>
  710.  
  711. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement