Codebox Select All
#1
Code inside the code boxes can now be selected by clicking anywhere within the title bar.

Code: (Select All)
Test me out! 
Reply
#2
Thank you very much! That makes things MUCH easier.
DO: LOOP: DO: LOOP
sha_na_na_na_na_na_na_na_na_na:
Reply
#3
Apparently it doesn't work on my iPad, but that doesn't seem such a big deal. It's not like I can code on it anyway. Wink
Reply
#4
Do you have any visual feedback when hovering the "Select all" button, here on Firefox is no visible change, however it works when clicking on it.

No big deal, just curious if it's a Firefox only quirk.
Reply
#5
It's a click event, not a hover event. But I can probably figure that out too in another week...
Reply
#6
(05-02-2022, 01:19 PM)SMcNeill Wrote: It's a click event, not a hover event.  But I can probably figure that out too in another week...

Nice!

Or... We could just copy the code directly to the clipboard with a technique like this...

Code: (Select All)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!-- start: showthread -->
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Checker Board - Checker Board Layout with Two Checkers and Mapping Routine.</title>
<!-- start: headerinclude -->




<!-- Phoenix Copy Code -->
    <style>
        #CopyCodeThis {
        float:right;
        margin-right:170px;
        margin-top: 20px;
        padding: 2px;
        background-color: #FFFFFF;
        font-size: 12px;
        width: 90px;
        text-align: center;
        font-weight: bold;
        border: 1px solid #666;
        border-radius: 1px;
        visibility:hidden;
      }
        #CopyCodeThis.CopyCode {
        margin-top: 30px;
        position: fixed;
        top: 0;
        right: 0;
        z-index: 9999;
        visibility:hidden;
      }
        .CopyCodeBelow {
        float:right;
        margin:8px 36px 0px 0px;
        font-size: 16px;
        color:rgb(204,204,204);
        font-family: Calibri;
        font-weight:bold;
        }
    </style>
    <script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
    <script>
      function CopyCodetothetop() {
        var windowTop = $(window)
          .scrollTop();
        var top = $('#CopyCodeHere')
          .offset()
          .top;
        if(windowTop > top) {
          $('#CopyCodeThis')
            .addClass('CopyCode');
          $('#CopyCodeHere')
            .height($('#CopyCodeThis')
              .outerHeight());
        } else {
          $('#CopyCodeThis')
            .removeClass('CopyCode');
          $('#CopyCodeHere')
            .height(0);
        }
      }
      $(function() {
        $(window)
          .scroll(CopyCodetothetop);
        CopyCodetothetop();
      });
    </script>

<script>
function doCopy(el){
var hideTimeout = 1500; //how many ms to wait before hiding after displaying
  //display the CopyCode
  var customAlert = document.getElementById("CopyCodeThis");
  customAlert.style.visibility = 'visible';

  //set up a timer to hide it, a.k.a a setTimeout()
  setTimeout(function() {
    customAlert.style.visibility = 'hidden';
  }, hideTimeout)

  let elTxt            = document.createElement('textarea')
  elTxt.value          = el.textContent
  elTxt.style.height   = '0px'
  elTxt.style.width    = '0px'
  elTxt.style.opacity  = '0'
  document.body.appendChild(elTxt)
  elTxt.select()
  document.execCommand('copy')
  document.body.removeChild(elTxt)
}
</script>
<!-- Phoenix Copy Code End -->





<link rel="alternate" type="application/rss+xml" title="Latest Threads (RSS 2.0)" href="https://staging.qb64phoenix.com/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="Latest Threads (Atom 1.0)" href="https://staging.qb64phoenix.com/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/jquery.js?ver=1823"></script>
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/jquery.plugins.min.js?ver=1821"></script>
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/general.js?ver=1827"></script>

<link type="text/css" rel="stylesheet" href="https://staging.qb64phoenix.com/cache/themes/theme11/global.css?t=1651285852" />
<link type="text/css" rel="stylesheet" href="https://staging.qb64phoenix.com/css.php?stylesheet%5B0%5D=4&stylesheet%5B1%5D=5&stylesheet%5B2%5D=7&stylesheet%5B3%5D=14" />

<script type="text/javascript">
<!--
    lang.unknown_error = "An unknown error has occurred.";
    lang.confirm_title = "Please Confirm";
    lang.expcol_collapse = "[-]";
    lang.expcol_expand = "[+]";
    lang.select2_match = "One result is available, press enter to select it.";
    lang.select2_matches = "{1} results are available, use up and down arrow keys to navigate.";
    lang.select2_nomatches = "No matches found";
    lang.select2_inputtooshort_single = "Please enter one or more character";
    lang.select2_inputtooshort_plural = "Please enter {1} or more characters";
    lang.select2_inputtoolong_single = "Please delete one character";
    lang.select2_inputtoolong_plural = "Please delete {1} characters";
    lang.select2_selectiontoobig_single = "You can only select one item";
    lang.select2_selectiontoobig_plural = "You can only select {1} items";
    lang.select2_loadmore = "Loading more results&hellip;";
    lang.select2_searching = "Searching&hellip;";

    var templates = {
        modal: '<div class=\"modal\">\
    <div style=\"overflow-y: auto; max-height: 400px;\">\
        <table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"tborder\">\
            <tr>\
                <td class=\"thead\"><strong>__title__</strong></td>\
            </tr>\
            <tr>\
                <td class=\"trow1\">__message__</td>\
            </tr>\
            <tr>\
                <td class=\"tfoot\">\
                    <div style=\"text-align: center\" class=\"modal_buttons\">__buttons__</div>\
                </td>\
            </tr>\
        </table>\
    </div>\
</div>',
        modal_button: '<input type=\"submit\" class=\"button\" value=\"__title__\"/>&nbsp;'
    };

    var cookieDomain = ".qb64phoenix.com";
    var cookiePath = "/forum/";
    var cookiePrefix = "";
    var cookieSecureFlag = "0";
    var deleteevent_confirm = "Are you sure you want to delete this event?";
    var removeattach_confirm = "Are you sure you want to remove the selected attachment from this post?";
    var loading_text = 'Loading. <br />Please Wait&hellip;';
    var saving_changes = 'Saving changes&hellip;';
    var use_xmlhttprequest = "1";
    var my_post_key = "df919e65dd29001dfcf0d8c500636fad";
    var rootpath = "https://staging.qb64phoenix.com";
    var imagepath = "https://staging.qb64phoenix.com/images";
      var yes_confirm = "Yes";
    var no_confirm = "No";
    var MyBBEditor = null;
    var spinner_image = "https://staging.qb64phoenix.com/images/spinner.gif";
    var spinner = "<img src='" + spinner_image +"' alt='' />";
    var modal_zindex = 9999;
// -->
</script>
<!-- end: headerinclude -->
<script type="text/javascript">
<!--
    var quickdelete_confirm = "Are you sure you want to delete this post?";
    var quickrestore_confirm = "Are you sure you want to restore this post?";
    var allowEditReason = "1";
    lang.save_changes = "Save Changes";
    lang.cancel_edit = "Cancel Edit";
    lang.quick_edit_update_error = "There was an error editing your reply:";
    lang.quick_reply_post_error = "There was an error posting your reply:";
    lang.quick_delete_error = "There was an error deleting your reply:";
    lang.quick_delete_success = "The post was deleted successfully.";
    lang.quick_delete_thread_success = "The thread was deleted successfully.";
    lang.quick_restore_error = "There was an error restoring your reply:";
    lang.quick_restore_success = "The post was restored successfully.";
    lang.editreason = "Edit Reason";
    lang.post_deleted_error = "You can not perform this action to a deleted post.";
    lang.softdelete_thread = "Soft Delete Thread";
    lang.restore_thread = "Restore Thread";
// -->
</script>
<!-- jeditable (jquery) -->
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/report.js?ver=1820"></script>
<script src="https://staging.qb64phoenix.com/jscripts/jeditable/jeditable.min.js"></script>
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/thread.js?ver=1827"></script>
</head>
<body>


<!-- Phoenix Copy Code -->
    <div id="CopyCodeHere"></div>
    <div id="CopyCodeThis">Code Copied</div>
<!-- Phoenix Copy Code End -->
   

    <!-- start: header -->
<div id="container">
        <a name="top" id="top"></a>
        <div id="header">
            <div id="logo">
                <div class="wrapper">
                    <a href="https://staging.qb64phoenix.com/index.php"><img src="https://staging.qb64phoenix.com/images/QB64 Phoenix Edition Banner.png" alt="QB64 Phoenix Edition" title="QB64 Phoenix Edition" /></a>
                    <ul class="menu top_links">
                        <!-- start: header_menu_portal -->
<li><a href="https://staging.qb64phoenix.com/portal.php" class="portal">Portal</a></li>
<!-- end: header_menu_portal -->
                        <!-- start: header_menu_search -->
<li><a href="https://staging.qb64phoenix.com/search.php" class="search">Search</a></li>
<!-- end: header_menu_search -->
                        <!-- start: header_menu_memberlist -->
<li><a href="https://staging.qb64phoenix.com/memberlist.php" class="memberlist">Member List</a></li>
<!-- end: header_menu_memberlist -->
                        <!-- start: header_menu_calendar -->
<li><a href="https://staging.qb64phoenix.com/calendar.php" class="calendar">Calendar</a></li>
<!-- end: header_menu_calendar -->
                        <li><a href="https://staging.qb64phoenix.com/misc.php?action=help" class="help">Help</a></li>
                    </ul>
                </div>
            </div>
            <div id="panel">
                <div class="upper">
                    <div class="wrapper">
                        <!-- start: header_quicksearch -->
                        <form action="https://staging.qb64phoenix.com/search.php">
                        <fieldset id="search">
                            <input name="keywords" type="text" class="textbox" />
                            <input value="Search" type="submit" class="button" />
                            <input type="hidden" name="action" value="do_search" />
                            <input type="hidden" name="postthread" value="1" />
                        </fieldset>
                        </form>
<!-- end: header_quicksearch -->
                        <!-- start: header_welcomeblock_member -->
<!-- Continuation of div(class="upper") as opened in the header template -->
    <span class="welcome"><strong>Welcome back, <a href="https://staging.qb64phoenix.com/member.php?action=profile&amp;uid=19">Pete</a></strong>. You last visited: <span title="05-02-2022">Today</span>, 11:23 AM <a href="https://staging.qb64phoenix.com/member.php?action=logout&amp;logoutkey=fac23762b6868c7ce474a3e424cfcbd6" class="logout">Log Out</a></span>
    </div>
</div>
<div class="lower">
    <div class="wrapper">
        <ul class="menu panel_links">
            <!-- start: header_welcomeblock_member_user -->
<li><a href="https://staging.qb64phoenix.com/usercp.php" class="usercp">User CP</a></li>
<!-- end: header_welcomeblock_member_user -->
            <!-- start: header_welcomeblock_member_moderator -->
<li><a href="https://staging.qb64phoenix.com/modcp.php" class="modcp">Mod CP</a></li>
<!-- end: header_welcomeblock_member_moderator -->
            <!-- start: header_welcomeblock_member_admin -->
<li><a href="https://staging.qb64phoenix.com/admin/index.php" class="admincp">Admin CP</a></li>
<!-- end: header_welcomeblock_member_admin -->
        </ul>
        <ul class="menu user_links">
            
            <!-- start: header_welcomeblock_member_search -->
<li><a href="https://staging.qb64phoenix.com/search.php?action=getnew">View New Posts</a></li>
<li><a href="https://staging.qb64phoenix.com/search.php?action=getdaily">View Today's Posts</a></li>
<!-- end: header_welcomeblock_member_search -->
            <!-- start: header_welcomeblock_member_pms -->
<li><a href="https://staging.qb64phoenix.com/private.php">Private Messages</a> (Unread 0, Total 153)</li>
<!-- end: header_welcomeblock_member_pms -->
        </ul>
    </div>
    <br class="clear" />
</div>
<!-- end: header_welcomeblock_member -->
                    <!-- </div> in header_welcomeblock_member and header_welcomeblock_guest -->
                <!-- </div> in header_welcomeblock_member and header_welcomeblock_guest -->
            </div>
        </div>
        <div id="content">
            <div class="wrapper">
                
                
                
                
                
                
                
                <!-- start: nav -->

<div class="navigation">
<!-- start: nav_bit -->
<a href="https://staging.qb64phoenix.com/index.php">QB64 Phoenix Edition</a><!-- start: nav_sep -->
&rsaquo;
<!-- end: nav_sep -->
<!-- end: nav_bit --><!-- start: nav_bit -->
<a href="forumdisplay.php?fid=1">QB64 Rising</a><!-- start: nav_sep -->
&rsaquo;
<!-- end: nav_sep -->
<!-- end: nav_bit --><!-- start: nav_bit -->
<a href="forumdisplay.php?fid=26">Prolific Programmers</a><!-- start: nav_sep -->
&rsaquo;
<!-- end: nav_sep -->
<!-- end: nav_bit --><!-- start: nav_bit -->
<a href="forumdisplay.php?fid=27">TheBOB</a>
<!-- end: nav_bit --><!-- start: nav_sep_active -->
<br /><img src="https://staging.qb64phoenix.com/images/nav_bit.png" alt="" />
<!-- end: nav_sep_active --><!-- start: nav_bit_active -->
<span class="active">Checker Board - Checker Board Layout with Two Checkers and Mapping Routine.</span>
<!-- end: nav_bit_active -->
</div>
<!-- end: nav -->
                <br />
<!-- end: header -->
    
    
    <div class="float_left">
        
    </div>
    <div class="float_right">
        <!-- start: showthread_newreply -->
<a href="newreply.php?tid=239" class="button new_reply_button"><span>New Reply</span></a>&nbsp;
<!-- end: showthread_newreply -->
    </div>
    
    <table border="0" cellspacing="0" cellpadding="5" class="tborder tfixed clear">
        <tr>
            <td class="thead">
                <div class="float_right">
                    <span class="smalltext"><strong><a href="showthread.php?mode=threaded&amp;tid=239&amp;pid=1011#pid1011">Threaded Mode</a></strong></span>
                </div>
                <div>
                    <strong>Checker Board - Checker Board Layout with Two Checkers and Mapping Routine.</strong>
                </div>
            </td>
        </tr>
<tr><td id="posts_container">
    <div id="posts">
        <!-- start: postbit -->

<a name="pid1011" id="pid1011"></a>
<div class="post " style="" id="post_1011">
<div class="post_author">
    <!-- start: postbit_avatar -->
<div class="author_avatar"><a href="member.php?action=profile&amp;uid=19"><img src="https://staging.qb64phoenix.com/uploads/avatars/avatar_19.gif?dateline=1651196742" alt="" width="100" height="100" /></a></div>
<!-- end: postbit_avatar -->
    <div class="author_information">
            <strong><span class="largetext"><a href="https://staging.qb64phoenix.com/member.php?action=profile&amp;uid=19"><span style="color: green;"><strong><em>Pete</em></strong></span></a></span></strong> <!-- start: postbit_online -->
<a href="online.php" title="Online"><img src="https://staging.qb64phoenix.com/images/buddy_online.png" border="0" alt="Online" class="buddy_status" /></a>
<!-- end: postbit_online --><br />
            <span class="smalltext">
                Administrator<br />
                <img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><br />
                
            </span>
    </div>
    <div class="author_statistics">
        <!-- start: postbit_author_user -->

    Posts: 217<br />
    Threads: 59<br />
    Joined: Apr 2022
    <!-- start: postbit_reputation -->
<br />Reputation: <!-- start: postbit_reputation_formatted_link -->
<a href="reputation.php?uid=19"><strong class="reputation_positive">11</strong></a>
<!-- end: postbit_reputation_formatted_link -->
<!-- end: postbit_reputation --><!-- start: postbit_warninglevel -->
<br />Warning Level: <a href="usercp.php"><!-- start: postbit_warninglevel_formatted -->
<span class="normal_warning">0%</span>
<!-- end: postbit_warninglevel_formatted --></a>
<!-- end: postbit_warninglevel -->
<!-- end: postbit_author_user -->
    </div>
</div>
<div class="post_content">
    <div class="post_head">
        <!-- start: postbit_posturl -->
<div class="float_right" style="vertical-align: top">
<strong><a href="showthread.php?tid=239&amp;pid=1011#pid1011" title="Checker Board - Checker Board Layout with Two Checkers and Mapping Routine.">#1</a></strong>
<!-- start: postbit_inlinecheck -->
<input type="checkbox" class="checkbox" name="inlinemod_1011" id="inlinemod_1011" value="1" style="vertical-align: middle; margin: -2px 0 0 5px;"   />
<!-- end: postbit_inlinecheck -->
</div>
<!-- end: postbit_posturl -->
        
        <span class="post_date">04-27-2022, 07:21 PM <span class="post_edit" id="edited_by_1011"></span></span>
        
    </div>
    <div class="post_body scaleimages" id="pid_1011">
        Checkerboard.bas by Bob Seguin.<br />
<a href="https://ibb.co/fF4MZsc" target="_blank" rel="noopener" class="mycode_url"><img src="https://i.ibb.co/fF4MZsc/Screenshot-582.png" loading="lazy"  alt="[Image: Screenshot-582.png]" class="mycode_img" /></a><br />
<span style="font-weight: bold;" class="mycode_b">Description:</span> Checker Board with two playing pieces. Read the code in the accompanying Mapping.bas utility below to see how it gets built. The pieces are just graphic characters, they cannot be moved.<br />
<br />

<!-- Phoenix Code Copy -->
<span class="CopyCodeBelow">Click below to copy code.</span>
<!--Phoenix Code Copy End -->

<div class="codeblock">
<div class="title">Code:</div><div class="body" dir="ltr">

<!-- Phoenix Code Copy -->
<code onclick="doCopy(this)">
'----------------------------------------------------------------------------<br />
'<br />
' &nbsp;&nbsp;AN INTRODUCTION TO GAME MAPPING (program example - freeware)<br />
'  (See MAPPING.BAS for mapping tutorial)<br />
' &nbsp;&nbsp;Copyright (2000) by Bob Seguin<br />
'<br />
'----------------------------------------------------------------------------<br />
<br />
_TITLE "Checkerboard.bas by Bob Seguin"<br />
<br />
DEFINT A-Z<br />
<br />
DECLARE SUB BOARD ()<br />
DECLARE SUB DrawMAN (x, y, Colr)<br />
<br />
DIM SHARED CheckerBOARD(1 TO 8, 1 TO 8)<br />
<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
<br />
FOR Row = 1 TO 8<br />
    FOR Col = 1 TO 8<br />
        READ CheckerBOARD(Row, Col)<br />
    NEXT Col<br />
NEXT Row<br />
<br />
SCREEN 12<br />
<br />
OUT &amp;H3C8, 0 'Color 0 set to a dark green for background<br />
OUT &amp;H3C9, 0 'so that it can be printed on without creating<br />
OUT &amp;H3C9, 30 'black boxes<br />
OUT &amp;H3C9, 0<br />
<br />
OUT &amp;H3C8, 1 'Color 1 set to a black since 0 has been changed<br />
OUT &amp;H3C9, 0<br />
OUT &amp;H3C9, 0<br />
OUT &amp;H3C9, 0<br />
<br />
OUT &amp;H3C8, 4 'Color 4 set to a brighter red<br />
OUT &amp;H3C9, 63<br />
OUT &amp;H3C9, 0<br />
OUT &amp;H3C9, 0<br />
<br />
BOARD 'Call to sub program to draw checkerboard<br />
<br />
RANDOMIZE TIMER 'Assure that each game will be different<br />
<br />
'Establish random location for blue game piece making sure it is not on<br />
'the starting square of the white game piece (8, 8). In most cases it won't<br />
'be, so this loop will only iterate once.  As long as one of the coordinates<br />
'isn't 8, it's legal, hence the "OR".<br />
<br />
DO<br />
    BlueMANRow = INT(RND * 8) + 1<br />
    BlueMANCol = INT(RND * 8) + 1<br />
LOOP UNTIL BlueMANRow &lt;&gt; 8 OR BlueMANCol &lt;&gt; 8<br />
<br />
'Adjust map array accordingly<br />
CheckerBOARD(BlueMANRow, BlueMANCol) = CheckerBOARD(BlueMANRow, BlueMANCol) + 10<br />
<br />
'Establish x/y coordinates for blue game piece<br />
BlueMANx = BlueMANCol * 50 + 98 '98 represents left square center - 50<br />
BlueMANy = BlueMANRow * 50 + 15 '15 represents top square center - 50<br />
<br />
'Call sub program that draws/erases game pieces<br />
DrawMAN BlueMANx, BlueMANy, 9<br />
<br />
'Repeat for white game piece, except starting row/column are fixed: 8, 8<br />
WhiteMANRow = 8<br />
WhiteMANCol = 8<br />
<br />
'We know the square is 8/8, therefore red (1) and the white player 20, so...<br />
CheckerBOARD(8, 8) = 21<br />
<br />
WhiteMANx = 8 * 50 + 98<br />
WhiteMANy = 8 * 50 + 15<br />
<br />
DrawMAN WhiteMANx, WhiteMANy, 15<br />
<br />
DO<br />
    DO<br />
        Key$ = INKEY$<br />
    LOOP UNTIL Key$ &lt;&gt; ""<br />
    RowINCREMENT = 0: ColINCREMENT = 0<br />
    SELECT CASE Key$<br />
        CASE CHR$(0) + "H" 'Up<br />
            IF WhiteMANRow &gt; 1 THEN RowINCREMENT = -1 ELSE RowINCREMENT = 0<br />
        CASE CHR$(0) + "P" 'Down<br />
            IF WhiteMANRow &lt; 8 THEN RowINCREMENT = 1 ELSE RowINCREMENT = 0<br />
        CASE CHR$(0) + "K" 'Left<br />
            IF WhiteMANCol &gt; 1 THEN ColINCREMENT = -1 ELSE ColINCREMENT = 0<br />
        CASE CHR$(0) + "M" 'Right<br />
            IF WhiteMANCol &lt; 8 THEN ColINCREMENT = 1 ELSE ColINCREMENT = 0<br />
        CASE CHR$(27)<br />
            SYSTEM<br />
    END SELECT<br />
<br />
    'Test for presence of blue game piece at proposed move location. Since<br />
    'the blue game piece is the only object we can possible encounter, I've<br />
    'simply used &gt; 1 as a test.  Other possiblities would require a more<br />
    'complex test.<br />
    IF CheckerBOARD(WhiteMANRow + RowINCREMENT, WhiteMANCol + ColINCREMENT) &gt; 1 THEN<br />
        RowINCREMENT = 0<br />
        ColINCREMENT = 0<br />
    END IF<br />
<br />
    'Here is an added wrinkle. If it is not possible to move in certain<br />
    'situations, why bother changing anything, -all you'll succeed in<br />
    'doing is cause your game piece to flutter on the spot. Hence, we<br />
    'enclose the next section in an IF block. To see the difference it<br />
    'makes, REM out the following IF line and the END IF at the bottom,<br />
    'then press F5 and hold down any of the arrow keys:<br />
    IF RowINCREMENT &lt;&gt; 0 OR ColINCREMENT &lt;&gt; 0 THEN '&lt;---REM out to test<br />
<br />
        'Decrement map array at old location<br />
        CheckerBOARD(WhiteMANRow, WhiteMANCol) = CheckerBOARD(WhiteMANRow, WhiteMANCol) - 20<br />
<br />
<br />
        'Erase white game piece at old location, using the value of the map array<br />
        'at those row/col coordinates to establish background color. Since there<br />
        'couldn't have been anything on that square but the white game piece,<br />
        'it's value after the previous line of code will be either 1:red or<br />
        '0:black. (Incidentally, I'm using COLOR 1 for black; see the OUT<br />
        'statements at the start of this program for why).<br />
        IF CheckerBOARD(WhiteMANRow, WhiteMANCol) = 1 THEN Colr = 4 ELSE Colr = 1<br />
        DrawMAN WhiteMANx, WhiteMANy, Colr 'Draws solid circle in background color<br />
<br />
        'Establish new row/column, x/y coordinates based on increment values<br />
        WhiteMANRow = WhiteMANRow + RowINCREMENT<br />
        WhiteMANCol = WhiteMANCol + ColINCREMENT<br />
        WhiteMANy = WhiteMANy + RowINCREMENT * 50<br />
        WhiteMANx = WhiteMANx + ColINCREMENT * 50<br />
<br />
        'Update map array accordingly<br />
        CheckerBOARD(WhiteMANRow, WhiteMANCol) = CheckerBOARD(WhiteMANRow, WhiteMANCol) + 20<br />
    <br />
        'Draw white game piece at new coordinates<br />
        DrawMAN WhiteMANx, WhiteMANy, 15<br />
&nbsp;&nbsp;<br />
    END IF '&lt;----REM out to test<br />
<br />
LOOP<br />
<br />
END<br />
<br />
'NOTE: In this simple little program, I could have taken a few short cuts,<br />
'      such as testing for the edge of the board and for the blue game piece<br />
'      at the same time, etc..  It is important, however, that you learn to<br />
'      think of these things separately, since most games involve much more<br />
'      complex circumstances and testing. A chess game, for example, would<br />
'      require establishing the computer's next move based on the position<br />
'      of every piece on the board (values in the array).<br />
'<br />
'      Incidentally, -what values would YOU assign to all 32 chess<br />
'      pieces?<br />
'<br />
'      Bob Seguin<br />
'<br />
'-----------------------------------------------------------------------------<br />
<br />
SUB BOARD<br />
<br />
    'Sub program draws checkerboard<br />
    '----------------------------------------------------------------------------<br />
<br />
    LINE (10, 10)-(629, 469), 8, B<br />
    LINE (7, 7)-(633, 473), 8, B<br />
    LINE (118, 35)-(527, 444), 8, BF<br />
    LINE (118, 35)-(527, 444), 1, B<br />
    FOR x = 123 TO 473 STEP 50<br />
        Col = Col + 1<br />
        FOR y = 40 TO 390 STEP 50<br />
            Row = Row + 1<br />
            LINE (x, y)-(x + 50, y + 50), 14, B<br />
            IF (Col + Row) MOD 2 THEN Colr = 1: ELSE Colr = 4<br />
            PAINT (x + 12, y + 12), Colr, 14<br />
        NEXT y<br />
    NEXT x<br />
    COLOR 8<br />
    LOCATE 30, 31: PRINT " PRESS [ESC] TO QUIT ";<br />
<br />
    '-----------------------------------------------------------------------------<br />
END SUB<br />
<br />
SUB DrawMAN (x, y, Colr)<br />
<br />
    'Sub program draws filled circle at coordinates x/y and in color Colr<br />
    '-----------------------------------------------------------------------------<br />
<br />
    WAIT &amp;H3DA, 8<br />
    WAIT &amp;H3DA, 8, 8 'Wait for completed screen retrace to avoid flicker<br />
<br />
    CIRCLE (x, y), 20, Colr<br />
    PAINT (x, y), Colr<br />
<br />
    '-----------------------------------------------------------------------------<br />
<br />
END SUB</code></div></div><br />
<br />
<br />
Mapping.bas<br />
<br />

<!-- Phoenix Code Copy -->
<span class="CopyCodeBelow">Click below to copy code.</span>
<!--Phoenix Code Copy End -->

<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr">

<!-- Phoenix Code Copy -->
<code onclick="doCopy(this)">
'----------------------------------------------------------------------------<br />
'<br />
' &nbsp;&nbsp;AN INTRODUCTION TO GAME MAPPING (tutorial - freeware)<br />
' &nbsp;&nbsp;Copyright (2000) by Bob Seguin<br />
'<br />
'<br />
'----------------------------------------------------------------------------<br />
DEFINT A-Z<br />
<br />
_TITLE "Mapping by Bob Seguin"<br />
<br />
'FOR OPENERS...<br />
'Let's start with a simple game example, -a checkerboard type game.<br />
'What we want to do is figure some way to represent this game board in<br />
'a numerical form, such that we can determine at any time and at any<br />
'location, the exact status at that location.  In more complex games<br />
'you might wish to know: Did I just run into a wall or enter a building?<br />
'Is a good guy or bad guy at this location?  If there is someone here,<br />
'is he carrying a weapon, and if so, what kind of weapon?  What is his<br />
'strength and skill level, etc..<br />
<br />
'But, for now, let's stick with our simple checkerboard:<br />
'To begin with, we create a two-dimensional array that represents a<br />
'checkerboard: 8 by 8 elements representing the 8 by 8 checkerboard pattern.<br />
'(It is automatically an integer array because of DEFINT A-Z at the top<br />
'of the program, but if you don't use DEFINT A-Z then add AS INTEGER).<br />
DIM SHARED CheckerBOARD(1 TO 8, 1 TO 8)<br />
<br />
'Next, we initialize the array using DATA and READ statements, so that<br />
'every red square is equal to 1 and every black square is equal to 0<br />
'in the array representation.<br />
<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
<br />
'You'll notice that even the DATA looks like a checkerboard.  Well that is<br />
'the value of a two-dimensional array map, it can be used to represent a<br />
'physical space using logically associated, numerical values.<br />
<br />
'Next we READ the DATA into the array...<br />
FOR Row = 1 TO 8<br />
    FOR Col = 1 TO 8<br />
        READ CheckerBOARD(Row, Col)<br />
    NEXT Col<br />
NEXT Row<br />
<br />
'In the above reading loop, we have to keep in mind that the DATA will be<br />
'read in the same order as it appears in the program, first row first, then<br />
'the second row, etc..  So we do "Row" as the outside loop and "Col" (column)<br />
'as the inside loop: Row 1,-Col 1, 2, 3, 4, etc..  Row 2,-Col 1, 2, 3, 4,<br />
'etc.. Take a second to see the logic of this reading loop.<br />
<br />
'If you look at the DATA, you'll see that the bottom-right square is a 1<br />
'(red). If you print CheckerBOARD(8, 8) you should get a 1, now.<br />
<br />
'PRINT CheckerBOARD(8, 8)  'The output of this will be a 1.<br />
'PRINT CheckerBOARD(1, 2)  'First row, second column; output is 0 (black).<br />
<br />
'SO NOW WHAT?<br />
'Let's imagine that you have two single game pieces.  We give a blue<br />
'piece a value of 10 and a white piece a value of 20.  Whenever a piece is<br />
'moved to a square, that square's value in the array is incremented by<br />
'the value of the piece moved to it.  Whenever a piece moves OFF a square,<br />
'the square's value is decremented by the piece's value. If I told you that<br />
'at some point in the game, CheckerBOARD(Row, Col) = 21, what information<br />
'would you have?<br />
<br />
'I'm sure you got it, but if not, check SUB Answer.<br />
<br />
'GAMEPLAY<br />
'During game play, there are two positions to be maintained for each game<br />
'piece, whether it's the good guy or the bad guy. The first is it's x/y<br />
'coordinates for purposes of drawing or erasing its image (usually PUT<br />
'statements).  The second is its location in the array.<br />
<br />
'Let's say that our checkerboard on the screen is made up of squares 50 by<br />
'50 pixels, -total image 400 by 400.  Every time we increment the x of a<br />
'piece by 50 pixels, for example (move right), we increment its column<br />
'position in the array by 1.  Whenever we draw the image at a new location,<br />
'we also increment its new position in the array by its value.  Conversely,<br />
'whenever we erase its visual image from a previous location, we also<br />
'decrement the corresponding value in the array.<br />
<br />
'It is in this way that we can "test" for factors which affect the play of<br />
'the game by simply accessing the array whenever a piece moves to that<br />
'particular Row/Column.  If for example we have placed (at random) a land<br />
'mine on CheckerBOARD(3, 7) and a piece moves there,... BOOOOOOMMMMM!!!.<br />
'The value of the land mine can be anything, as long as we know what the<br />
'number means.  For example, if a land mine is worth 100, then as long as<br />
'the value of the square is &gt;= 100, we know there's a mine there.  It's fun<br />
'to work out values that tell us all there is to know about a square.  You<br />
'can use MOD, integer division (\), etc. for testing purposes, giving you<br />
'multiple circumstances expressed as a single value.<br />
<br />
<br />
'GETTING STARTED<br />
'Start simple, as with the checkerboard example and two game pieces.  Locate<br />
'one game piece at random. RANDOMIZE TIMER assures a different game each time:<br />
'RANDOMIZE TIMER<br />
'BlueMANRow = FIX(RND * 8) + 1 'See FIX in the Help/Index if you don't<br />
'BlueMANCol = FIX(RND * 8) + 1 'understand its use.<br />
'CheckerBOARD(BlueMANRow, BlueMANCol) = CheckerBOARD(BlueMANRow, BlueMANCol) + 10<br />
<br />
'Notice that we did not merely assign the value of the blue game piece to the<br />
'square, -a common error.  Instead, we said that WHATEVER the current value<br />
'of the square, we want it increased by 10.  So if the square was worth 1, it<br />
'is now worth 11.  If it was worth 0, it is now worth 10.  If it was a red<br />
'square with a land mine on it, it is now worth 111.<br />
<br />
'Use the arrow keys to move the white game piece.  What follows is a basic<br />
'game-play loop.  All game events and INPUT are inside the outer DO/LOOP:<br />
'DO<br />
'DO<br />
'Ky$ = INKEY$<br />
'LOOP WHILE Ky$ = ""  'Wait for key to be pressed<br />
'RowINCREMENT = 0: ColINCREMENT = 0  'Reset increments to zero<br />
'SELECT CASE Ky$<br />
'    CASE CHR$(0) + "H" 'Up arrow key<br />
'    CASE CHR$(0) + "P" 'Down arrow key<br />
'    CASE CHR$(0) + "K" 'Left arrow key<br />
'    CASE CHR$(0) + "M" 'Right arrow key<br />
'    CASE CHR$(27)      'Escape key (end at any time)<br />
'        SYSTEM<br />
'END SELECT<br />
'LOOP<br />
<br />
'ORDER OF EVENTS<br />
'First, we set the increments/decrements based on the key press for<br />
'row/column, checking first to determine if the move is legal:<br />
'Example, up arrow is pressed:<br />
'CASE CHR$(0) + "H" 'Up arrow key<br />
'    IF WhiteMANRow &gt; 1 THEN RowINCREMENT = -1 ELSE RowINCREMENT = 0<br />
'    (Otherwise you might fall off the checkerboard!)<br />
<br />
'Second, following the arrow key SELECT CASE, check the value of the square<br />
'you've just chosen to move to. If it's value tells you that the blue game<br />
'piece is on it, reset the INCREMENT values to 0.<br />
'IF CheckerBOARD(WhiteMANRow + RowINCREMENT, WhiteMANCol + ColINCREMENT) &gt; 1 THEN<br />
'    RowINCREMENT = 0<br />
'    ColINCREMENT = 0<br />
'END IF<br />
'In more complex programs, it is in this preceding section that all<br />
'circumstances would be tested for and game play altered accordingly,<br />
'possibly involving sub program calls, etc.. Normally, SELECT CASE would<br />
'be used since a great many values would have to be tested for and SELECT<br />
'CASE is faster for this type of multiple option checking.<br />
<br />
'And now, you execute the move (this section of code will not affect<br />
'anything if the increment values haven't been altered).<br />
<br />
'1.) Erase game piece image at previous location and decrement the value of<br />
'    CheckerBOARD(WhiteMANRow, WhiteMANCol), accordingly. This is possible<br />
'    because we have not yet altered the row/column, x/y coordinates, so<br />
'    they still represent the game piece's old position.  All we've done at<br />
'    this point is assign values to RowINCREMENT and ColINCREMENT.<br />
<br />
'2.) Increment the row/column of the game piece as well as its x/y values:<br />
'    WhiteMANRow = WhiteMANRow + RowINCREMENT<br />
'    WhiteMANCol = WhiteMANCol + ColINCREMENT<br />
'    WhiteMANy = WhiteMANy + RowINCREMENT * 50<br />
'    WhiteMANx = WhiteMANx + ColINCREMENT * 50<br />
'    (It doesn't matter what these increments are, plus or minus, value or<br />
'    no value.  They will automatically provide the correct x/y changes.<br />
'    you might take a moment to see the logic of these statements before<br />
'    moving on).<br />
<br />
'3.) Draw game piece at the new location and increment the corresponding<br />
'    element in the array:<br />
'    CheckerBOARD(WhiteMANRow, WhiteMANCol) = CheckerBOARD(WhiteMANRow, WhiteMANCol) + 20<br />
<br />
'SUMMING UP...<br />
'The game "Checked.BAS" is the finished version of this game.  You should,<br />
'however, see if you can work it out on your own before looking at that game.<br />
'If you're stumped, by all means, check it out.<br />
<br />
'If your little game is successful, you should be able to move your game<br />
'piece anywhere on the board without going off the edge, and whenever you<br />
'encounter the other piece on its randomly-selected square, you should be<br />
'prevented from moving there.<br />
<br />
'I've included a checkerboard graphic in SCREEN 12 that you can use to<br />
'get you started.  Copy and paste the BOARD sub to use it (just press F5.<br />
'to see it).  See this sub also for x/y coordinates to get you started<br />
'drawing the simple blue/white game pieces.  Since these images ARE simple,<br />
'you might just use CIRCLE and PAINT statements for erasing and<br />
'drawing images (keep in mind that you can check for the square's color<br />
'when erasing by checking CheckerBOARD(Row, Col). Square_value MOD 10 = 1<br />
'means a red square and square_value MOD 10 = 0 means black, since both<br />
'game pieces as well as a land mine (your option) MOD 10 = 0).<br />
'<br />
'                                   &nbsp;&nbsp;Good luck!<br />
'                                   &nbsp;&nbsp;Bob Seguin<br />
'<br />
'-----------------------------------------------------------------------------<br />
<br />
SCREEN 12<br />
<br />
OUT &amp;H3C8, 2 'Color 2 set to a darker green for background<br />
OUT &amp;H3C9, 0<br />
OUT &amp;H3C9, 30<br />
OUT &amp;H3C9, 0<br />
<br />
OUT &amp;H3C8, 4 'Color 4 set to a brighter red<br />
OUT &amp;H3C9, 63<br />
OUT &amp;H3C9, 0<br />
OUT &amp;H3C9, 0<br />
<br />
BOARD 'Call to sub program<br />
a$ = INPUT$(1) 'Wait for a key press<br />
END<br />
<br />
DEFSNG A-Z<br />
SUB Answer<br />
    'A red square with a white game piece on it.<br />
END SUB<br />
<br />
DEFINT A-Z<br />
SUB BOARD<br />
<br />
    PAINT (0, 0), 2<br />
    LINE (7, 7)-(633, 473), 8, B<br />
    LINE (10, 10)-(629, 469), 8, B<br />
    LINE (118, 35)-(527, 444), 8, BF<br />
    LINE (118, 35)-(527, 444), 0, B<br />
    FOR x = 123 TO 473 STEP 50<br />
        Col = Col + 1<br />
        FOR y = 40 TO 390 STEP 50<br />
            Row = Row + 1<br />
            LINE (x, y)-(x + 50, y + 50), 14, B<br />
            IF (Col + Row) MOD 2 THEN Colr = 0 ELSE Colr = 4<br />
            PAINT (x + 12, y + 12), Colr, 14<br />
        NEXT y<br />
    NEXT x<br />
<br />
    CIRCLE (148, 65), 20, 15 '148:65 are top row, first column center.<br />
    PAINT (148, 65), 15<br />
    CheckerBOARD(1, 1) = CheckerBOARD(1, 1) + 20<br />
    CIRCLE (198, 65), 20, 9 '198:65 are top row, second column center, etc.<br />
    PAINT (198, 65), 9<br />
    CheckerBOARD(1, 2) = CheckerBOARD(1, 2) + 10<br />
<br />
END SUB</code></div></div>
    </div>
    
    
    <div class="post_meta" id="post_meta_1011">
        <!-- start: postbit_iplogged_hiden -->
IP Address: <a href="moderation.php?action=getip&amp;pid=1011" onclick="MyBB.getIP(1011); return false;">Logged</a>
<!-- end: postbit_iplogged_hiden -->
        <div class="float_right">
            
        </div>
    </div>
    <!-- start: postbit_editreason -->
<div class="editreason" id="editreason_1011_original" style="display: none;"><label for="editreason">Edit Reason:</label> <input type="text" class="textbox" style="margin: 6px 0;" name="editreason" size="40" maxlength="150" id="quickedit_1011_editreason_original" value="" /><br /></div>
<!-- end: postbit_editreason -->
</div>
<div class="post_controls">
    <div class="postbit_buttons author_buttons float_left">
        <!-- start: postbit_find -->
<a href="search.php?action=finduser&amp;uid=19" title="Find all posts by this user" class="postbit_find"><span>Find</span></a>
<!-- end: postbit_find -->
    </div>
    <div class="postbit_buttons post_management_buttons float_right">
        <!-- start: postbit_edit -->
<a href="editpost.php?pid=1011" id="edit_post_1011" title="Edit this post" class="postbit_edit postbit_mirage"><span>Edit</span></a>
<div id="edit_post_1011_popup" class="popup_menu" style="display: none;"><div class="popup_item_container"><a href="javascript:void(0)" class="popup_item quick_edit_button" id="quick_edit_post_1011">Quick Edit</a></div><div class="popup_item_container"><a href="editpost.php?pid=1011" class="popup_item">Full Edit</a></div></div>
<script type="text/javascript">
// <!--
    if(use_xmlhttprequest == "1")
    {
        $("#edit_post_1011").popupMenu();
    }
// -->
</script>
<!-- end: postbit_edit --><!-- start: postbit_quickdelete -->
<a href="editpost.php?pid=1011" onclick="Thread.deletePost(1011); return false;" id="quick_delete_1011" title="Delete this thread" class="postbit_qdelete postbit_mirage"><span>Delete</span></a>
<!-- end: postbit_quickdelete --><!-- start: postbit_quickrestore -->
<a href="editpost.php?pid=1011" onclick="Thread.restorePost(1011); return false;" id="quick_restore_1011" title="Restore this thread" class="postbit_qrestore"><span>Restore</span></a>
<!-- end: postbit_quickrestore --><!-- start: postbit_quote -->
<a href="newreply.php?tid=239&amp;replyto=1011" title="Quote this message in a reply" class="postbit_quote postbit_mirage"><span>Reply</span></a>
<!-- end: postbit_quote --><!-- start: postbit_multiquote -->
<a href="javascript:void(0)" onclick="Thread.multiQuote(1011); return false;" style="display: none;" id="multiquote_link_1011" title="Quote this post" class="postbit_multiquote postbit_mirage"><span id="multiquote_1011">Quote</span></a>
<script type="text/javascript">
//<!--
    $('#multiquote_link_1011').css("display", "");
// -->
</script>
<!-- end: postbit_multiquote -->
    </div>
</div>
</div>
<!-- end: postbit -->
    </div>
</td></tr>
        <tr>
            <td class="tfoot">
                <!-- start: showthread_search -->
    <div class="float_right">
        <form action="search.php" method="post">
            <input type="hidden" name="action" value="thread" />
            <input type="hidden" name="tid" value="239" />
            <input type="text" name="keywords" value="Enter Keywords" onfocus="if(this.value == 'Enter Keywords') { this.value = ''; }" onblur="if(this.value=='') { this.value='Enter Keywords'; }" class="textbox" size="25" />
            <input type="submit" class="button" value="Search Thread" />
        </form>
    </div>
<!-- end: showthread_search -->
                <div>
                    <strong>&laquo; <a href="showthread.php?tid=239&amp;action=nextoldest">Next Oldest</a> | <a href="showthread.php?tid=239&amp;action=nextnewest">Next Newest</a> &raquo;</strong>
                </div>
            </td>
        </tr>
    </table>
    <div class="float_left">
        
    </div>
    <div style="padding-top: 4px;" class="float_right">
        <!-- start: showthread_newreply -->
<a href="newreply.php?tid=239" class="button new_reply_button"><span>New Reply</span></a>&nbsp;
<!-- end: showthread_newreply -->
    </div>
    <br class="clear" />
    <!-- start: showthread_quickreply -->

<div id="quickreply_spinner" class="showthread_spinner" style="display: none"><img src="https://staging.qb64phoenix.com/images/spinner.gif" /></div>
<br />

<form method="post" action="newreply.php?tid=239&amp;processed=1" name="quick_reply_form" id="quick_reply_form">
    <input type="hidden" name="my_post_key" value="df919e65dd29001dfcf0d8c500636fad" />
    <input type="hidden" name="subject" value="RE: Checker Board - Checker Board Layout with Two Checkers and Mapping Routine." />
    <input type="hidden" name="action" value="do_newreply" />
    <input type="hidden" name="posthash" value="78b4609b71b766aa033a50051e3562f0" id="posthash" />
    <input type="hidden" name="quoted_ids" value="" id="quoted_ids" />
    <input type="hidden" name="lastpid" id="lastpid" value="1011" />
    <input type="hidden" name="from_page" value="1" />
    <input type="hidden" name="tid" value="239" />
    <input type="hidden" name="method" value="quickreply" />

    <table border="0" cellspacing="0" cellpadding="5" class="tborder">
        <thead>
            <tr>
                <td class="thead" colspan="2">
                    <div class="expcolimage"><img src="https://staging.qb64phoenix.com/images/collapse.png" id="quickreply_img" class="expander" alt="[-]" title="[-]" /></div>
                    <div><strong>Quick Reply</strong></div>
                </td>
            </tr>
        </thead>
        <tbody style="" id="quickreply_e">
            <tr>
                <td class="trow_shaded" valign="top" width="22%">
                    <strong>Message</strong><br />
                    <span class="smalltext">Type your reply to this message here.<br /><br />
                    <!-- start: showthread_quickreply_options_signature -->
<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" checked="checked" />&nbsp;<strong>Signature</strong></label><br />
<!-- end: showthread_quickreply_options_signature -->
                    <label><input type="checkbox" class="checkbox" name="postoptions[disablesmilies]" value="1" />&nbsp;<strong>Disable Smilies</strong></label><!-- start: showthread_quickreply_options_close -->
<br /><label><input type="checkbox" class="checkbox" name="modoptions[closethread]" value="1" checked="checked" />&nbsp;<strong>Close Thread</strong></label>
<!-- end: showthread_quickreply_options_close --><!-- start: showthread_quickreply_options_stick -->
<br /><label><input type="checkbox" class="checkbox" name="modoptions[stickthread]" value="1" />&nbsp;<strong>Stick Thread</strong></label>
<!-- end: showthread_quickreply_options_stick --></span>
                </td>
                <td class="trow_shaded">
                    <div style="width: 95%">
                        <textarea style="width: 100%; padding: 4px; margin: 0;" rows="8" cols="80" name="message" id="message" tabindex="1"></textarea>
                    </div>
                    <div class="editor_control_bar" style="width: 95%; padding: 4px; margin-top: 3px; display: none;" id="quickreply_multiquote">
                        <span class="smalltext">
                            You have selected one or more posts to quote. <a href="./newreply.php?tid=239&amp;load_all_quotes=1" onclick="return Thread.loadMultiQuoted();">Quote these posts now</a> or <a href="javascript:void(0)" onclick="Thread.clearMultiQuoted(); return false;">deselect them</a>.
                        </span>
                    </div>
                </td>
            </tr>
            
            <tr>
                <td colspan="2" align="center" class="tfoot"><input type="submit" class="button" value="Post Reply" tabindex="2" accesskey="s" id="quick_reply_submit" /> <input type="submit" class="button" name="previewpost" value="Preview Post" tabindex="3" /></td>
            </tr>
        </tbody>
    </table>
</form>
<!-- end: showthread_quickreply -->
    
    
    <br />
    <div class="float_left">
        <ul class="thread_tools">
            <!-- start: showthread_printthread -->
<li class="printable"><a href="printthread.php?tid=239">View a Printable Version</a></li>
<!-- end: showthread_printthread -->
            <!-- start: showthread_send_thread -->
<li class="sendthread"><a href="sendthread.php?tid=239">Send this Thread to a Friend</a></li>
<!-- end: showthread_send_thread -->
            <!-- start: showthread_subscription -->
<li class="subscription_add"><a href="usercp.php?action=addsubscription&amp;tid=239&amp;my_post_key=df919e65dd29001dfcf0d8c500636fad">Subscribe to this thread</a></li>
<!-- end: showthread_subscription -->
            
        </ul>
    </div>

    <div class="float_right" style="text-align: right;">
        <!-- start: showthread_moderationoptions -->
<!-- start: showthread_inlinemoderation -->
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/inline_moderation.js?ver=1821"></script>
<form action="moderation.php" method="post" style="margin-top: 0; margin-bottom: 0;" id="inlinemoderation_options">
<input type="hidden" name="my_post_key" value="df919e65dd29001dfcf0d8c500636fad" />
<input type="hidden" name="tid" value="239" />
<input type="hidden" name="modtype" value="inlinepost" />
<span class="smalltext"><strong>Inline Post Moderation:</strong></span>
<select name="action" id="inlinemoderation_options_selector">
<!-- start: showthread_inlinemoderation_standard -->
<optgroup label="Standard Tools">
    <!-- start: showthread_inlinemoderation_softdelete -->
<option value="multisoftdeleteposts">Soft Delete Posts</option>
<!-- end: showthread_inlinemoderation_softdelete -->
    <!-- start: showthread_inlinemoderation_restore -->
<option value="multirestoreposts">Restore Posts</option>
<!-- end: showthread_inlinemoderation_restore -->
    <!-- start: showthread_inlinemoderation_delete -->
<option value="multideleteposts">Delete Posts Permanently</option>
<!-- end: showthread_inlinemoderation_delete -->
    <!-- start: showthread_inlinemoderation_manage -->
<option value="multimergeposts">Merge Posts</option>
<option value="multisplitposts">Split Posts</option>
<option value="multimoveposts">Move Posts</option>
<!-- end: showthread_inlinemoderation_manage -->
    <!-- start: showthread_inlinemoderation_approve -->
<option value="multiapproveposts">Approve Posts</option>
<option value="multiunapproveposts">Unapprove Posts</option>
<!-- end: showthread_inlinemoderation_approve -->
</optgroup>
<!-- end: showthread_inlinemoderation_standard -->

</select>
<input type="submit" class="button" name="go" value="Go (0)" id="inline_go" />&nbsp;
<input type="button" class="button" onclick="inlineModeration.clearChecked();" value="Clear" />
</form>
<script type="text/javascript">
<!--
    var go_text = "Go";
    var all_text = "41";
    var inlineType = "thread";
    var inlineId = 239;

    $("#inlinemoderation_options_selector").on('change', function() {
        $("#inlinemoderation_options").trigger('submit');
    })
// -->
</script><br />
<!-- end: showthread_inlinemoderation -->
<form action="moderation.php" method="post" style="margin-top: 0; margin-bottom: 0;" id="moderator_options">
    <input type="hidden" name="modtype" value="thread" />
    <input type="hidden" name="tid" value="239" />
    <input type="hidden" name="my_post_key" value="df919e65dd29001dfcf0d8c500636fad" />
    <span class="smalltext">
    <strong>Moderation Options:</strong></span>
    <select name="action" id="moderator_options_selector">
        <option value="delayedmoderation">Delayed Moderation</option>
        <!-- start: showthread_moderationoptions_standard -->
<optgroup label="Standard Tools">
<!-- start: showthread_moderationoptions_threadnotes -->
<option value="threadnotes" selected="selected">Edit / View Thread Notes</option>
<!-- end: showthread_moderationoptions_threadnotes -->
<!-- start: showthread_moderationoptions_openclose -->
<option class="option_mirage" value="openclosethread">Open / Close Thread</option>
<!-- end: showthread_moderationoptions_openclose -->
<!-- start: showthread_moderationoptions_softdelete -->
<option value="softdeletethread">Soft Delete Thread</option>
<!-- end: showthread_moderationoptions_softdelete -->
<!-- start: showthread_moderationoptions_delete -->
<option value="deletethread">Delete Thread Permanently</option>
<!-- end: showthread_moderationoptions_delete -->

<!-- start: showthread_moderationoptions_stickunstick -->
<option class="option_mirage" value="stick">Stick / Unstick Thread</option>
<!-- end: showthread_moderationoptions_stickunstick -->
<!-- start: showthread_moderationoptions_manage -->
<option class="option_mirage" value="move">Move / Copy Thread</option>
<option class="option_mirage" value="split">Split Thread</option>
<option class="option_mirage" value="merge">Merge Threads</option>
<option class="option_mirage" value="removeredirects">Remove Redirects</option>
<option class="option_mirage" value="removesubscriptions">Remove All Subscriptions</option>
<!-- end: showthread_moderationoptions_manage -->
<!-- start: showthread_moderationoptions_unapprove -->
<option class="option_mirage" value="unapprovethread">Unapprove Thread</option>
<!-- end: showthread_moderationoptions_unapprove -->
</optgroup>
<!-- end: showthread_moderationoptions_standard -->
        
    </select>
    <!-- start: gobutton -->
<input type="submit" class="button" value="Go" />
<!-- end: gobutton -->
</form>
<br />
<script type="text/javascript">
<!--
    $("#moderator_options_selector").on('change', function() {
        $("#moderator_options").trigger('submit');
    })
//-->
</script>
<!-- end: showthread_moderationoptions -->
        <!-- start: forumjump_advanced -->
<form action="forumdisplay.php" method="get">
<span class="smalltext"><strong>Forum Jump:</strong></span>
<select name="fid" class="forumjump">
<option value="-4">Private Messages</option>
<option value="-3">User Control Panel</option>
<option value="-5">Who's Online</option>
<option value="-2">Search</option>
<option value="-1">Forum Home</option>
<!-- start: forumjump_bit -->
<option value="1" > QB64 Rising</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="3" >-- Code and Stuff</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="7" >---- Programs</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="8" >---- Utilities</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="9" >---- Works in Progress</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="10" >---- Help Me!</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="21" >-- Expanding Horizons (Libraries)</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="24" >---- One Hit Wonders</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="23" >---- RhoSigma</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="22" >---- SMcNeill</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="30" >---- Spriggsy</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="31" >---- Terry Ritchie</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="26" >-- Prolific Programmers</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="27" selected="selected">---- TheBOB</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="36" >---- bplus</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="33" >---- Pete</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="34" >---- Dav</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="28" >---- Keybone</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="32" >---- RhoSigma</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="29" >---- SMcNeill</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="11" > Chatting and Socializing</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="2" >-- General Discussion</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="37" >---- NSFW (18+)</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="35" >---- Freedom to Speak</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="12" >-- Site Suggestions</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="16" > Official Links</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="18" >-- Announcements</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="41" >-- QB64 Phoenix Edition Wiki and Repo</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="25" >---- Wiki Discussion</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="42" >---- Repo Discussion</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="13" >-- Learning Resources and Archives</option>
<!-- end: forumjump_bit -->
</select>
<!-- start: gobutton -->
<input type="submit" class="button" value="Go" />
<!-- end: gobutton -->
</form>
<script type="text/javascript">
$(".forumjump").on('change', function() {
    var option = $(this).val();

    if(option < 0)
    {
        window.location = 'forumdisplay.php?fid='+option;
    }
    else
    {
        window.location = 'forumdisplay.php?fid='+option;
    }
});
</script>
<!-- end: forumjump_advanced -->
    </div>
    <br class="clear" />
    <!-- start: showthread_usersbrowsing -->
<br />
<span class="smalltext">Users browsing this thread: <a href="member.php?action=profile&amp;uid=19" title="Reading&hellip; (06:04 PM)"><span style="color: green;"><strong><em>Pete</em></strong></span></a></span>
<br />
<!-- end: showthread_usersbrowsing -->
    <!-- start: footer -->
<!-- start: debug_summary -->
<div id="debug">Generated in 25 ms (59.45% PHP / 40.55% MySQL) <br />SQL Queries: 27 / Server Load: 0.01 / Memory Usage: 2 MB<br />[<a href="/forum/showthread.php?tid=239&amp;debug=1" target="_blank">Advanced Details</a>]<br /></div>
<!-- end: debug_summary -->
    </div>
</div>
<div id="footer">
    <div class="upper">
        <div class="wrapper">
            
            <!-- start: footer_themeselect -->
<div class="theme">
<form method="POST" action="/forum/showthread.php" id="theme_select">
    <input type="hidden" name="tid" value="239" />

    <input type="hidden" name="my_post_key" value="df919e65dd29001dfcf0d8c500636fad" />
    <!-- start: footer_themeselector -->
<select name="theme" onchange="MyBB.changeTheme();">
<optgroup label="Quick Theme Select">
<!-- start: usercp_themeselector_option -->
<option value="2">Default</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="5">--Black</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="6">--Calm</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="7">--Dawn</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="8">--Earth</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="9">--Flame</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="10">--Leaf</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="11" selected="selected">--Night</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="12">--Sun</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="13">--Twilight</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="14">--Water</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="4">Square</option>
<!-- end: usercp_themeselector_option -->
</optgroup>
</select>
<!-- end: footer_themeselector -->
    <!-- start: gobutton -->
<input type="submit" class="button" value="Go" />
<!-- end: gobutton -->
</form>
</div>
<!-- end: footer_themeselect -->
            <ul class="menu bottom_links">
                <!-- start: footer_showteamlink -->
<li><a href="showteam.php">Forum Team</a></li>
<!-- end: footer_showteamlink -->
                <!-- start: footer_contactus -->
<li><a href="https://staging.qb64phoenix.com/contact.php">Contact Us</a></li>
<!-- end: footer_contactus -->
                <li><a href="https://qb64phoenix.com/">QB64 Phoenix Edition</a></li>
                <li><a href="#top">Return to Top</a></li>
                <li><a href="https://staging.qb64phoenix.com/archive/index.php?thread-239.html">Lite (Archive) Mode</a></li>
                <li><a href="https://staging.qb64phoenix.com/misc.php?action=markread&amp;my_post_key=df919e65dd29001dfcf0d8c500636fad">Mark all forums read</a></li>
                <li><a href="https://staging.qb64phoenix.com/misc.php?action=syndication">RSS Syndication</a></li>
            </ul>
        </div>
    </div>
    <div class="lower">
        <div class="wrapper">
            <span id="current_time"><strong>Current time:</strong> 05-02-2022, 06:04 PM</span>
            <span id="copyright">
                <!-- MyBB is free software developed and maintained by a volunteer community.
                    It would be much appreciated by the MyBB Group if you left the full copyright and "powered by" notice intact,
                    to show your support for MyBB.  If you choose to remove or modify the copyright below,
                    you may be refused support on the MyBB Community Forums.

                    This is free software, support us and we'll support you. -->
                Powered By <a href="https://mybb.com" target="_blank" rel="noopener">MyBB 1.8.30</a>, &copy; 2002-2022 <a href="https://mybb.com" target="_blank" rel="noopener">MyBB Group</a>.
                <!-- End powered by -->
            </span>
        </div>
    </div>
</div>
<!-- The following piece of code allows MyBB to run scheduled tasks. DO NOT REMOVE --><!-- start: task_image -->
<img src="https://staging.qb64phoenix.com/task.php" width="1" height="1" alt="" />
<!-- end: task_image --><!-- End task image code -->
<!-- start: global_dst_detection -->
<script type="text/javascript">if(MyBB) { $([document, window]).on("load", function() { MyBB.detectDSTChange('0'); }); }</script>
<!-- end: global_dst_detection -->
</div>
<!-- end: footer -->
    <script type="text/javascript">
        var thread_deleted = "0";
        if(thread_deleted == "1")
        {
            $("#quick_reply_form, .new_reply_button, .thread_tools, .inline_rating").hide();
            $("#moderator_options_selector option.option_mirage").attr("disabled","disabled");
        }
    </script>
<script async type="text/javascript" src="jscripts/imgbb.js" charset="utf-8"></script>
</body>
</html>
<!-- end: showthread -->


It even provides a nice little "Code Copied" 1.5 second alert in the right upper corner of the screen. Like the one Steve posted, it doesn't require each code box be IDed, so we don't need a plugin to generate unique ID code tags.

For the sake of simplicty, Steve's uses a lot less code, especially without a mouse over event at present.

Code: (Select All)
<script>
        document.querySelectorAll('.codeblock').forEach(codeblock => {
                codeblock.querySelector('.title').addEventListener('click', () => {
                    window.getSelection().selectAllChildren(codeblock.querySelector('code'));
                });
            });
    </script>

I removed that for my demo, so there wouldn't be any confusion, but if you add it back in, thy both place nice, we could actually select all and/or copy with a mouse click that way.

@admin

As far as highlighting on mouseover. This can be done easily...

Add this below your Select All JavaScript:

---------------------------------
<style>
.SelectAllHover {
    background-color: transparent;
}
.SelectAllHover:hover {
    background-color: blue;
}
</style>
---------------------------------

And...

CHANGE: Code: (Select All)

TO:

Code: <span class="SelectAllHover">(Select All)</span>

---------------------------------------------------------------------------------

The results would look like this:

Code: (Select All)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><!-- start: showthread -->
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Checker Board - Checker Board Layout with Two Checkers and Mapping Routine.</title>
<!-- start: headerinclude -->
<link rel="alternate" type="application/rss+xml" title="Latest Threads (RSS 2.0)" href="https://staging.qb64phoenix.com/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="Latest Threads (Atom 1.0)" href="https://staging.qb64phoenix.com/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/jquery.js?ver=1823"></script>
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/jquery.plugins.min.js?ver=1821"></script>
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/general.js?ver=1827"></script>

<link type="text/css" rel="stylesheet" href="https://staging.qb64phoenix.com/cache/themes/theme11/global.css?t=1651285852" />
<link type="text/css" rel="stylesheet" href="https://staging.qb64phoenix.com/css.php?stylesheet%5B0%5D=4&stylesheet%5B1%5D=5&stylesheet%5B2%5D=7&stylesheet%5B3%5D=14" />

<script type="text/javascript">
<!--
    lang.unknown_error = "An unknown error has occurred.";
    lang.confirm_title = "Please Confirm";
    lang.expcol_collapse = "[-]";
    lang.expcol_expand = "[+]";
    lang.select2_match = "One result is available, press enter to select it.";
    lang.select2_matches = "{1} results are available, use up and down arrow keys to navigate.";
    lang.select2_nomatches = "No matches found";
    lang.select2_inputtooshort_single = "Please enter one or more character";
    lang.select2_inputtooshort_plural = "Please enter {1} or more characters";
    lang.select2_inputtoolong_single = "Please delete one character";
    lang.select2_inputtoolong_plural = "Please delete {1} characters";
    lang.select2_selectiontoobig_single = "You can only select one item";
    lang.select2_selectiontoobig_plural = "You can only select {1} items";
    lang.select2_loadmore = "Loading more results&hellip;";
    lang.select2_searching = "Searching&hellip;";

    var templates = {
        modal: '<div class=\"modal\">\
    <div style=\"overflow-y: auto; max-height: 400px;\">\
        <table border=\"0\" cellspacing=\"0\" cellpadding=\"5\" class=\"tborder\">\
            <tr>\
                <td class=\"thead\"><strong>__title__</strong></td>\
            </tr>\
            <tr>\
                <td class=\"trow1\">__message__</td>\
            </tr>\
            <tr>\
                <td class=\"tfoot\">\
                    <div style=\"text-align: center\" class=\"modal_buttons\">__buttons__</div>\
                </td>\
            </tr>\
        </table>\
    </div>\
</div>',
        modal_button: '<input type=\"submit\" class=\"button\" value=\"__title__\"/>&nbsp;'
    };

    var cookieDomain = ".qb64phoenix.com";
    var cookiePath = "/forum/";
    var cookiePrefix = "";
    var cookieSecureFlag = "0";
    var deleteevent_confirm = "Are you sure you want to delete this event?";
    var removeattach_confirm = "Are you sure you want to remove the selected attachment from this post?";
    var loading_text = 'Loading. <br />Please Wait&hellip;';
    var saving_changes = 'Saving changes&hellip;';
    var use_xmlhttprequest = "1";
    var my_post_key = "df919e65dd29001dfcf0d8c500636fad";
    var rootpath = "https://staging.qb64phoenix.com";
    var imagepath = "https://staging.qb64phoenix.com/images";
      var yes_confirm = "Yes";
    var no_confirm = "No";
    var MyBBEditor = null;
    var spinner_image = "https://staging.qb64phoenix.com/images/spinner.gif";
    var spinner = "<img src='" + spinner_image +"' alt='' />";
    var modal_zindex = 9999;
// -->
</script>
<!-- end: headerinclude -->
<script type="text/javascript">
<!--
    var quickdelete_confirm = "Are you sure you want to delete this post?";
    var quickrestore_confirm = "Are you sure you want to restore this post?";
    var allowEditReason = "1";
    lang.save_changes = "Save Changes";
    lang.cancel_edit = "Cancel Edit";
    lang.quick_edit_update_error = "There was an error editing your reply:";
    lang.quick_reply_post_error = "There was an error posting your reply:";
    lang.quick_delete_error = "There was an error deleting your reply:";
    lang.quick_delete_success = "The post was deleted successfully.";
    lang.quick_delete_thread_success = "The thread was deleted successfully.";
    lang.quick_restore_error = "There was an error restoring your reply:";
    lang.quick_restore_success = "The post was restored successfully.";
    lang.editreason = "Edit Reason";
    lang.post_deleted_error = "You can not perform this action to a deleted post.";
    lang.softdelete_thread = "Soft Delete Thread";
    lang.restore_thread = "Restore Thread";
// -->
</script>
<!-- jeditable (jquery) -->
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/report.js?ver=1820"></script>
<script src="https://staging.qb64phoenix.com/jscripts/jeditable/jeditable.min.js"></script>
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/thread.js?ver=1827"></script>
</head>
<body>
    <!-- start: header -->
<div id="container">
        <a name="top" id="top"></a>
        <div id="header">
            <div id="logo">
                <div class="wrapper">
                    <a href="https://staging.qb64phoenix.com/index.php"><img src="https://staging.qb64phoenix.com/images/QB64 Phoenix Edition Banner.png" alt="QB64 Phoenix Edition" title="QB64 Phoenix Edition" /></a>
                    <ul class="menu top_links">
                        <!-- start: header_menu_portal -->
<li><a href="https://staging.qb64phoenix.com/portal.php" class="portal">Portal</a></li>
<!-- end: header_menu_portal -->
                        <!-- start: header_menu_search -->
<li><a href="https://staging.qb64phoenix.com/search.php" class="search">Search</a></li>
<!-- end: header_menu_search -->
                        <!-- start: header_menu_memberlist -->
<li><a href="https://staging.qb64phoenix.com/memberlist.php" class="memberlist">Member List</a></li>
<!-- end: header_menu_memberlist -->
                        <!-- start: header_menu_calendar -->
<li><a href="https://staging.qb64phoenix.com/calendar.php" class="calendar">Calendar</a></li>
<!-- end: header_menu_calendar -->
                        <li><a href="https://staging.qb64phoenix.com/misc.php?action=help" class="help">Help</a></li>
                    </ul>
                </div>
            </div>
            <div id="panel">
                <div class="upper">
                    <div class="wrapper">
                        <!-- start: header_quicksearch -->
                        <form action="https://staging.qb64phoenix.com/search.php">
                        <fieldset id="search">
                            <input name="keywords" type="text" class="textbox" />
                            <input value="Search" type="submit" class="button" />
                            <input type="hidden" name="action" value="do_search" />
                            <input type="hidden" name="postthread" value="1" />
                        </fieldset>
                        </form>
<!-- end: header_quicksearch -->
                        <!-- start: header_welcomeblock_member -->
<!-- Continuation of div(class="upper") as opened in the header template -->
    <span class="welcome"><strong>Welcome back, <a href="https://staging.qb64phoenix.com/member.php?action=profile&amp;uid=19">Pete</a></strong>. You last visited: <span title="05-02-2022">Today</span>, 06:04 PM <a href="https://staging.qb64phoenix.com/member.php?action=logout&amp;logoutkey=fac23762b6868c7ce474a3e424cfcbd6" class="logout">Log Out</a></span>
    </div>
</div>
<div class="lower">
    <div class="wrapper">
        <ul class="menu panel_links">
            <!-- start: header_welcomeblock_member_user -->
<li><a href="https://staging.qb64phoenix.com/usercp.php" class="usercp">User CP</a></li>
<!-- end: header_welcomeblock_member_user -->
            <!-- start: header_welcomeblock_member_moderator -->
<li><a href="https://staging.qb64phoenix.com/modcp.php" class="modcp">Mod CP</a></li>
<!-- end: header_welcomeblock_member_moderator -->
            <!-- start: header_welcomeblock_member_admin -->
<li><a href="https://staging.qb64phoenix.com/admin/index.php" class="admincp">Admin CP</a></li>
<!-- end: header_welcomeblock_member_admin -->
        </ul>
        <ul class="menu user_links">
            
            <!-- start: header_welcomeblock_member_search -->
<li><a href="https://staging.qb64phoenix.com/search.php?action=getnew">View New Posts</a></li>
<li><a href="https://staging.qb64phoenix.com/search.php?action=getdaily">View Today's Posts</a></li>
<!-- end: header_welcomeblock_member_search -->
            <!-- start: header_welcomeblock_member_pms -->
<li><a href="https://staging.qb64phoenix.com/private.php">Private Messages</a> (Unread 0, Total 153)</li>
<!-- end: header_welcomeblock_member_pms -->
        </ul>
    </div>
    <br class="clear" />
</div>
<!-- end: header_welcomeblock_member -->
                    <!-- </div> in header_welcomeblock_member and header_welcomeblock_guest -->
                <!-- </div> in header_welcomeblock_member and header_welcomeblock_guest -->
            </div>
        </div>
        <div id="content">
            <div class="wrapper">
                
                
                
                
                
                
                
                <!-- start: nav -->

<div class="navigation">
<!-- start: nav_bit -->
<a href="https://staging.qb64phoenix.com/index.php">QB64 Phoenix Edition</a><!-- start: nav_sep -->
&rsaquo;
<!-- end: nav_sep -->
<!-- end: nav_bit --><!-- start: nav_bit -->
<a href="forumdisplay.php?fid=1">QB64 Rising</a><!-- start: nav_sep -->
&rsaquo;
<!-- end: nav_sep -->
<!-- end: nav_bit --><!-- start: nav_bit -->
<a href="forumdisplay.php?fid=26">Prolific Programmers</a><!-- start: nav_sep -->
&rsaquo;
<!-- end: nav_sep -->
<!-- end: nav_bit --><!-- start: nav_bit -->
<a href="forumdisplay.php?fid=27">TheBOB</a>
<!-- end: nav_bit --><!-- start: nav_sep_active -->
<br /><img src="https://staging.qb64phoenix.com/images/nav_bit.png" alt="" />
<!-- end: nav_sep_active --><!-- start: nav_bit_active -->
<span class="active">Checker Board - Checker Board Layout with Two Checkers and Mapping Routine.</span>
<!-- end: nav_bit_active -->
</div>
<!-- end: nav -->
                <br />
<!-- end: header -->
    
    
    <div class="float_left">
        
    </div>
    <div class="float_right">
        <!-- start: showthread_newreply -->
<a href="newreply.php?tid=239" class="button new_reply_button"><span>New Reply</span></a>&nbsp;
<!-- end: showthread_newreply -->
    </div>
    
    <table border="0" cellspacing="0" cellpadding="5" class="tborder tfixed clear">
        <tr>
            <td class="thead">
                <div class="float_right">
                    <span class="smalltext"><strong><a href="showthread.php?mode=threaded&amp;tid=239&amp;pid=1011#pid1011">Threaded Mode</a></strong></span>
                </div>
                <div>
                    <strong>Checker Board - Checker Board Layout with Two Checkers and Mapping Routine.</strong>
                </div>
            </td>
        </tr>
<tr><td id="posts_container">
    <div id="posts">
        <!-- start: postbit -->

<a name="pid1011" id="pid1011"></a>
<div class="post " style="" id="post_1011">
<div class="post_author">
    <!-- start: postbit_avatar -->
<div class="author_avatar"><a href="member.php?action=profile&amp;uid=19"><img src="https://staging.qb64phoenix.com/uploads/avatars/avatar_19.gif?dateline=1651196742" alt="" width="100" height="100" /></a></div>
<!-- end: postbit_avatar -->
    <div class="author_information">
            <strong><span class="largetext"><a href="https://staging.qb64phoenix.com/member.php?action=profile&amp;uid=19"><span style="color: green;"><strong><em>Pete</em></strong></span></a></span></strong> <!-- start: postbit_online -->
<a href="online.php" title="Online"><img src="https://staging.qb64phoenix.com/images/buddy_online.png" border="0" alt="Online" class="buddy_status" /></a>
<!-- end: postbit_online --><br />
            <span class="smalltext">
                Administrator<br />
                <img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><img src="images/star.png" border="0" alt="*" /><br />
                
            </span>
    </div>
    <div class="author_statistics">
        <!-- start: postbit_author_user -->

    Posts: 217<br />
    Threads: 59<br />
    Joined: Apr 2022
    <!-- start: postbit_reputation -->
<br />Reputation: <!-- start: postbit_reputation_formatted_link -->
<a href="reputation.php?uid=19"><strong class="reputation_positive">11</strong></a>
<!-- end: postbit_reputation_formatted_link -->
<!-- end: postbit_reputation --><!-- start: postbit_warninglevel -->
<br />Warning Level: <a href="usercp.php"><!-- start: postbit_warninglevel_formatted -->
<span class="normal_warning">0%</span>
<!-- end: postbit_warninglevel_formatted --></a>
<!-- end: postbit_warninglevel -->
<!-- end: postbit_author_user -->
    </div>
</div>
<div class="post_content">
    <div class="post_head">
        <!-- start: postbit_posturl -->
<div class="float_right" style="vertical-align: top">
<strong><a href="showthread.php?tid=239&amp;pid=1011#pid1011" title="Checker Board - Checker Board Layout with Two Checkers and Mapping Routine.">#1</a></strong>
<!-- start: postbit_inlinecheck -->
<input type="checkbox" class="checkbox" name="inlinemod_1011" id="inlinemod_1011" value="1" style="vertical-align: middle; margin: -2px 0 0 5px;"   />
<!-- end: postbit_inlinecheck -->
</div>
<!-- end: postbit_posturl -->
        
        <span class="post_date">04-27-2022, 07:21 PM <span class="post_edit" id="edited_by_1011"></span></span>
        
    </div>
    <div class="post_body scaleimages" id="pid_1011">
        Checkerboard.bas by Bob Seguin.<br />
<a href="https://ibb.co/fF4MZsc" target="_blank" rel="noopener" class="mycode_url"><img src="https://i.ibb.co/fF4MZsc/Screenshot-582.png" loading="lazy"  alt="[Image: Screenshot-582.png]" class="mycode_img" /></a><br />
<span style="font-weight: bold;" class="mycode_b">Description:</span> Checker Board with two playing pieces. Read the code in the accompanying Mapping.bas utility below to see how it gets built. The pieces are just graphic characters, they cannot be moved.<br />
<br />
<div class="codeblock"><div class="title">Code: <span class="SelectAllHover">(Select All)</span></div><div class="body" dir="ltr"><code>'----------------------------------------------------------------------------<br />
'<br />
' &nbsp;&nbsp;AN INTRODUCTION TO GAME MAPPING (program example - freeware)<br />
'  (See MAPPING.BAS for mapping tutorial)<br />
' &nbsp;&nbsp;Copyright (2000) by Bob Seguin<br />
'<br />
'----------------------------------------------------------------------------<br />
<br />
_TITLE "Checkerboard.bas by Bob Seguin"<br />
<br />
DEFINT A-Z<br />
<br />
DECLARE SUB BOARD ()<br />
DECLARE SUB DrawMAN (x, y, Colr)<br />
<br />
DIM SHARED CheckerBOARD(1 TO 8, 1 TO 8)<br />
<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
<br />
FOR Row = 1 TO 8<br />
    FOR Col = 1 TO 8<br />
        READ CheckerBOARD(Row, Col)<br />
    NEXT Col<br />
NEXT Row<br />
<br />
SCREEN 12<br />
<br />
OUT &amp;H3C8, 0 'Color 0 set to a dark green for background<br />
OUT &amp;H3C9, 0 'so that it can be printed on without creating<br />
OUT &amp;H3C9, 30 'black boxes<br />
OUT &amp;H3C9, 0<br />
<br />
OUT &amp;H3C8, 1 'Color 1 set to a black since 0 has been changed<br />
OUT &amp;H3C9, 0<br />
OUT &amp;H3C9, 0<br />
OUT &amp;H3C9, 0<br />
<br />
OUT &amp;H3C8, 4 'Color 4 set to a brighter red<br />
OUT &amp;H3C9, 63<br />
OUT &amp;H3C9, 0<br />
OUT &amp;H3C9, 0<br />
<br />
BOARD 'Call to sub program to draw checkerboard<br />
<br />
RANDOMIZE TIMER 'Assure that each game will be different<br />
<br />
'Establish random location for blue game piece making sure it is not on<br />
'the starting square of the white game piece (8, 8). In most cases it won't<br />
'be, so this loop will only iterate once.  As long as one of the coordinates<br />
'isn't 8, it's legal, hence the "OR".<br />
<br />
DO<br />
    BlueMANRow = INT(RND * 8) + 1<br />
    BlueMANCol = INT(RND * 8) + 1<br />
LOOP UNTIL BlueMANRow &lt;&gt; 8 OR BlueMANCol &lt;&gt; 8<br />
<br />
'Adjust map array accordingly<br />
CheckerBOARD(BlueMANRow, BlueMANCol) = CheckerBOARD(BlueMANRow, BlueMANCol) + 10<br />
<br />
'Establish x/y coordinates for blue game piece<br />
BlueMANx = BlueMANCol * 50 + 98 '98 represents left square center - 50<br />
BlueMANy = BlueMANRow * 50 + 15 '15 represents top square center - 50<br />
<br />
'Call sub program that draws/erases game pieces<br />
DrawMAN BlueMANx, BlueMANy, 9<br />
<br />
'Repeat for white game piece, except starting row/column are fixed: 8, 8<br />
WhiteMANRow = 8<br />
WhiteMANCol = 8<br />
<br />
'We know the square is 8/8, therefore red (1) and the white player 20, so...<br />
CheckerBOARD(8, 8) = 21<br />
<br />
WhiteMANx = 8 * 50 + 98<br />
WhiteMANy = 8 * 50 + 15<br />
<br />
DrawMAN WhiteMANx, WhiteMANy, 15<br />
<br />
DO<br />
    DO<br />
        Key$ = INKEY$<br />
    LOOP UNTIL Key$ &lt;&gt; ""<br />
    RowINCREMENT = 0: ColINCREMENT = 0<br />
    SELECT CASE Key$<br />
        CASE CHR$(0) + "H" 'Up<br />
            IF WhiteMANRow &gt; 1 THEN RowINCREMENT = -1 ELSE RowINCREMENT = 0<br />
        CASE CHR$(0) + "P" 'Down<br />
            IF WhiteMANRow &lt; 8 THEN RowINCREMENT = 1 ELSE RowINCREMENT = 0<br />
        CASE CHR$(0) + "K" 'Left<br />
            IF WhiteMANCol &gt; 1 THEN ColINCREMENT = -1 ELSE ColINCREMENT = 0<br />
        CASE CHR$(0) + "M" 'Right<br />
            IF WhiteMANCol &lt; 8 THEN ColINCREMENT = 1 ELSE ColINCREMENT = 0<br />
        CASE CHR$(27)<br />
            SYSTEM<br />
    END SELECT<br />
<br />
    'Test for presence of blue game piece at proposed move location. Since<br />
    'the blue game piece is the only object we can possible encounter, I've<br />
    'simply used &gt; 1 as a test.  Other possiblities would require a more<br />
    'complex test.<br />
    IF CheckerBOARD(WhiteMANRow + RowINCREMENT, WhiteMANCol + ColINCREMENT) &gt; 1 THEN<br />
        RowINCREMENT = 0<br />
        ColINCREMENT = 0<br />
    END IF<br />
<br />
    'Here is an added wrinkle. If it is not possible to move in certain<br />
    'situations, why bother changing anything, -all you'll succeed in<br />
    'doing is cause your game piece to flutter on the spot. Hence, we<br />
    'enclose the next section in an IF block. To see the difference it<br />
    'makes, REM out the following IF line and the END IF at the bottom,<br />
    'then press F5 and hold down any of the arrow keys:<br />
    IF RowINCREMENT &lt;&gt; 0 OR ColINCREMENT &lt;&gt; 0 THEN '&lt;---REM out to test<br />
<br />
        'Decrement map array at old location<br />
        CheckerBOARD(WhiteMANRow, WhiteMANCol) = CheckerBOARD(WhiteMANRow, WhiteMANCol) - 20<br />
<br />
<br />
        'Erase white game piece at old location, using the value of the map array<br />
        'at those row/col coordinates to establish background color. Since there<br />
        'couldn't have been anything on that square but the white game piece,<br />
        'it's value after the previous line of code will be either 1:red or<br />
        '0:black. (Incidentally, I'm using COLOR 1 for black; see the OUT<br />
        'statements at the start of this program for why).<br />
        IF CheckerBOARD(WhiteMANRow, WhiteMANCol) = 1 THEN Colr = 4 ELSE Colr = 1<br />
        DrawMAN WhiteMANx, WhiteMANy, Colr 'Draws solid circle in background color<br />
<br />
        'Establish new row/column, x/y coordinates based on increment values<br />
        WhiteMANRow = WhiteMANRow + RowINCREMENT<br />
        WhiteMANCol = WhiteMANCol + ColINCREMENT<br />
        WhiteMANy = WhiteMANy + RowINCREMENT * 50<br />
        WhiteMANx = WhiteMANx + ColINCREMENT * 50<br />
<br />
        'Update map array accordingly<br />
        CheckerBOARD(WhiteMANRow, WhiteMANCol) = CheckerBOARD(WhiteMANRow, WhiteMANCol) + 20<br />
    <br />
        'Draw white game piece at new coordinates<br />
        DrawMAN WhiteMANx, WhiteMANy, 15<br />
&nbsp;&nbsp;<br />
    END IF '&lt;----REM out to test<br />
<br />
LOOP<br />
<br />
END<br />
<br />
'NOTE: In this simple little program, I could have taken a few short cuts,<br />
'      such as testing for the edge of the board and for the blue game piece<br />
'      at the same time, etc..  It is important, however, that you learn to<br />
'      think of these things separately, since most games involve much more<br />
'      complex circumstances and testing. A chess game, for example, would<br />
'      require establishing the computer's next move based on the position<br />
'      of every piece on the board (values in the array).<br />
'<br />
'      Incidentally, -what values would YOU assign to all 32 chess<br />
'      pieces?<br />
'<br />
'      Bob Seguin<br />
'<br />
'-----------------------------------------------------------------------------<br />
<br />
SUB BOARD<br />
<br />
    'Sub program draws checkerboard<br />
    '----------------------------------------------------------------------------<br />
<br />
    LINE (10, 10)-(629, 469), 8, B<br />
    LINE (7, 7)-(633, 473), 8, B<br />
    LINE (118, 35)-(527, 444), 8, BF<br />
    LINE (118, 35)-(527, 444), 1, B<br />
    FOR x = 123 TO 473 STEP 50<br />
        Col = Col + 1<br />
        FOR y = 40 TO 390 STEP 50<br />
            Row = Row + 1<br />
            LINE (x, y)-(x + 50, y + 50), 14, B<br />
            IF (Col + Row) MOD 2 THEN Colr = 1: ELSE Colr = 4<br />
            PAINT (x + 12, y + 12), Colr, 14<br />
        NEXT y<br />
    NEXT x<br />
    COLOR 8<br />
    LOCATE 30, 31: PRINT " PRESS [ESC] TO QUIT ";<br />
<br />
    '-----------------------------------------------------------------------------<br />
END SUB<br />
<br />
SUB DrawMAN (x, y, Colr)<br />
<br />
    'Sub program draws filled circle at coordinates x/y and in color Colr<br />
    '-----------------------------------------------------------------------------<br />
<br />
    WAIT &amp;H3DA, 8<br />
    WAIT &amp;H3DA, 8, 8 'Wait for completed screen retrace to avoid flicker<br />
<br />
    CIRCLE (x, y), 20, Colr<br />
    PAINT (x, y), Colr<br />
<br />
    '-----------------------------------------------------------------------------<br />
<br />
END SUB</code></div></div><br />
<br />
<br />
Mapping.bas<br />
<br />
<div class="codeblock"><div class="title">Code: Code: <span class="SelectAllHover">(Select All)</span></div><div class="body" dir="ltr"><code>'----------------------------------------------------------------------------<br />
'<br />
' &nbsp;&nbsp;AN INTRODUCTION TO GAME MAPPING (tutorial - freeware)<br />
' &nbsp;&nbsp;Copyright (2000) by Bob Seguin<br />
'<br />
'<br />
'----------------------------------------------------------------------------<br />
DEFINT A-Z<br />
<br />
_TITLE "Mapping by Bob Seguin"<br />
<br />
'FOR OPENERS...<br />
'Let's start with a simple game example, -a checkerboard type game.<br />
'What we want to do is figure some way to represent this game board in<br />
'a numerical form, such that we can determine at any time and at any<br />
'location, the exact status at that location.  In more complex games<br />
'you might wish to know: Did I just run into a wall or enter a building?<br />
'Is a good guy or bad guy at this location?  If there is someone here,<br />
'is he carrying a weapon, and if so, what kind of weapon?  What is his<br />
'strength and skill level, etc..<br />
<br />
'But, for now, let's stick with our simple checkerboard:<br />
'To begin with, we create a two-dimensional array that represents a<br />
'checkerboard: 8 by 8 elements representing the 8 by 8 checkerboard pattern.<br />
'(It is automatically an integer array because of DEFINT A-Z at the top<br />
'of the program, but if you don't use DEFINT A-Z then add AS INTEGER).<br />
DIM SHARED CheckerBOARD(1 TO 8, 1 TO 8)<br />
<br />
'Next, we initialize the array using DATA and READ statements, so that<br />
'every red square is equal to 1 and every black square is equal to 0<br />
'in the array representation.<br />
<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
DATA 1,0,1,0,1,0,1,0<br />
DATA 0,1,0,1,0,1,0,1<br />
<br />
'You'll notice that even the DATA looks like a checkerboard.  Well that is<br />
'the value of a two-dimensional array map, it can be used to represent a<br />
'physical space using logically associated, numerical values.<br />
<br />
'Next we READ the DATA into the array...<br />
FOR Row = 1 TO 8<br />
    FOR Col = 1 TO 8<br />
        READ CheckerBOARD(Row, Col)<br />
    NEXT Col<br />
NEXT Row<br />
<br />
'In the above reading loop, we have to keep in mind that the DATA will be<br />
'read in the same order as it appears in the program, first row first, then<br />
'the second row, etc..  So we do "Row" as the outside loop and "Col" (column)<br />
'as the inside loop: Row 1,-Col 1, 2, 3, 4, etc..  Row 2,-Col 1, 2, 3, 4,<br />
'etc.. Take a second to see the logic of this reading loop.<br />
<br />
'If you look at the DATA, you'll see that the bottom-right square is a 1<br />
'(red). If you print CheckerBOARD(8, 8) you should get a 1, now.<br />
<br />
'PRINT CheckerBOARD(8, 8)  'The output of this will be a 1.<br />
'PRINT CheckerBOARD(1, 2)  'First row, second column; output is 0 (black).<br />
<br />
'SO NOW WHAT?<br />
'Let's imagine that you have two single game pieces.  We give a blue<br />
'piece a value of 10 and a white piece a value of 20.  Whenever a piece is<br />
'moved to a square, that square's value in the array is incremented by<br />
'the value of the piece moved to it.  Whenever a piece moves OFF a square,<br />
'the square's value is decremented by the piece's value. If I told you that<br />
'at some point in the game, CheckerBOARD(Row, Col) = 21, what information<br />
'would you have?<br />
<br />
'I'm sure you got it, but if not, check SUB Answer.<br />
<br />
'GAMEPLAY<br />
'During game play, there are two positions to be maintained for each game<br />
'piece, whether it's the good guy or the bad guy. The first is it's x/y<br />
'coordinates for purposes of drawing or erasing its image (usually PUT<br />
'statements).  The second is its location in the array.<br />
<br />
'Let's say that our checkerboard on the screen is made up of squares 50 by<br />
'50 pixels, -total image 400 by 400.  Every time we increment the x of a<br />
'piece by 50 pixels, for example (move right), we increment its column<br />
'position in the array by 1.  Whenever we draw the image at a new location,<br />
'we also increment its new position in the array by its value.  Conversely,<br />
'whenever we erase its visual image from a previous location, we also<br />
'decrement the corresponding value in the array.<br />
<br />
'It is in this way that we can "test" for factors which affect the play of<br />
'the game by simply accessing the array whenever a piece moves to that<br />
'particular Row/Column.  If for example we have placed (at random) a land<br />
'mine on CheckerBOARD(3, 7) and a piece moves there,... BOOOOOOMMMMM!!!.<br />
'The value of the land mine can be anything, as long as we know what the<br />
'number means.  For example, if a land mine is worth 100, then as long as<br />
'the value of the square is &gt;= 100, we know there's a mine there.  It's fun<br />
'to work out values that tell us all there is to know about a square.  You<br />
'can use MOD, integer division (\), etc. for testing purposes, giving you<br />
'multiple circumstances expressed as a single value.<br />
<br />
<br />
'GETTING STARTED<br />
'Start simple, as with the checkerboard example and two game pieces.  Locate<br />
'one game piece at random. RANDOMIZE TIMER assures a different game each time:<br />
'RANDOMIZE TIMER<br />
'BlueMANRow = FIX(RND * 8) + 1 'See FIX in the Help/Index if you don't<br />
'BlueMANCol = FIX(RND * 8) + 1 'understand its use.<br />
'CheckerBOARD(BlueMANRow, BlueMANCol) = CheckerBOARD(BlueMANRow, BlueMANCol) + 10<br />
<br />
'Notice that we did not merely assign the value of the blue game piece to the<br />
'square, -a common error.  Instead, we said that WHATEVER the current value<br />
'of the square, we want it increased by 10.  So if the square was worth 1, it<br />
'is now worth 11.  If it was worth 0, it is now worth 10.  If it was a red<br />
'square with a land mine on it, it is now worth 111.<br />
<br />
'Use the arrow keys to move the white game piece.  What follows is a basic<br />
'game-play loop.  All game events and INPUT are inside the outer DO/LOOP:<br />
'DO<br />
'DO<br />
'Ky$ = INKEY$<br />
'LOOP WHILE Ky$ = ""  'Wait for key to be pressed<br />
'RowINCREMENT = 0: ColINCREMENT = 0  'Reset increments to zero<br />
'SELECT CASE Ky$<br />
'    CASE CHR$(0) + "H" 'Up arrow key<br />
'    CASE CHR$(0) + "P" 'Down arrow key<br />
'    CASE CHR$(0) + "K" 'Left arrow key<br />
'    CASE CHR$(0) + "M" 'Right arrow key<br />
'    CASE CHR$(27)      'Escape key (end at any time)<br />
'        SYSTEM<br />
'END SELECT<br />
'LOOP<br />
<br />
'ORDER OF EVENTS<br />
'First, we set the increments/decrements based on the key press for<br />
'row/column, checking first to determine if the move is legal:<br />
'Example, up arrow is pressed:<br />
'CASE CHR$(0) + "H" 'Up arrow key<br />
'    IF WhiteMANRow &gt; 1 THEN RowINCREMENT = -1 ELSE RowINCREMENT = 0<br />
'    (Otherwise you might fall off the checkerboard!)<br />
<br />
'Second, following the arrow key SELECT CASE, check the value of the square<br />
'you've just chosen to move to. If it's value tells you that the blue game<br />
'piece is on it, reset the INCREMENT values to 0.<br />
'IF CheckerBOARD(WhiteMANRow + RowINCREMENT, WhiteMANCol + ColINCREMENT) &gt; 1 THEN<br />
'    RowINCREMENT = 0<br />
'    ColINCREMENT = 0<br />
'END IF<br />
'In more complex programs, it is in this preceding section that all<br />
'circumstances would be tested for and game play altered accordingly,<br />
'possibly involving sub program calls, etc.. Normally, SELECT CASE would<br />
'be used since a great many values would have to be tested for and SELECT<br />
'CASE is faster for this type of multiple option checking.<br />
<br />
'And now, you execute the move (this section of code will not affect<br />
'anything if the increment values haven't been altered).<br />
<br />
'1.) Erase game piece image at previous location and decrement the value of<br />
'    CheckerBOARD(WhiteMANRow, WhiteMANCol), accordingly. This is possible<br />
'    because we have not yet altered the row/column, x/y coordinates, so<br />
'    they still represent the game piece's old position.  All we've done at<br />
'    this point is assign values to RowINCREMENT and ColINCREMENT.<br />
<br />
'2.) Increment the row/column of the game piece as well as its x/y values:<br />
'    WhiteMANRow = WhiteMANRow + RowINCREMENT<br />
'    WhiteMANCol = WhiteMANCol + ColINCREMENT<br />
'    WhiteMANy = WhiteMANy + RowINCREMENT * 50<br />
'    WhiteMANx = WhiteMANx + ColINCREMENT * 50<br />
'    (It doesn't matter what these increments are, plus or minus, value or<br />
'    no value.  They will automatically provide the correct x/y changes.<br />
'    you might take a moment to see the logic of these statements before<br />
'    moving on).<br />
<br />
'3.) Draw game piece at the new location and increment the corresponding<br />
'    element in the array:<br />
'    CheckerBOARD(WhiteMANRow, WhiteMANCol) = CheckerBOARD(WhiteMANRow, WhiteMANCol) + 20<br />
<br />
'SUMMING UP...<br />
'The game "Checked.BAS" is the finished version of this game.  You should,<br />
'however, see if you can work it out on your own before looking at that game.<br />
'If you're stumped, by all means, check it out.<br />
<br />
'If your little game is successful, you should be able to move your game<br />
'piece anywhere on the board without going off the edge, and whenever you<br />
'encounter the other piece on its randomly-selected square, you should be<br />
'prevented from moving there.<br />
<br />
'I've included a checkerboard graphic in SCREEN 12 that you can use to<br />
'get you started.  Copy and paste the BOARD sub to use it (just press F5.<br />
'to see it).  See this sub also for x/y coordinates to get you started<br />
'drawing the simple blue/white game pieces.  Since these images ARE simple,<br />
'you might just use CIRCLE and PAINT statements for erasing and<br />
'drawing images (keep in mind that you can check for the square's color<br />
'when erasing by checking CheckerBOARD(Row, Col). Square_value MOD 10 = 1<br />
'means a red square and square_value MOD 10 = 0 means black, since both<br />
'game pieces as well as a land mine (your option) MOD 10 = 0).<br />
'<br />
'                                   &nbsp;&nbsp;Good luck!<br />
'                                   &nbsp;&nbsp;Bob Seguin<br />
'<br />
'-----------------------------------------------------------------------------<br />
<br />
SCREEN 12<br />
<br />
OUT &amp;H3C8, 2 'Color 2 set to a darker green for background<br />
OUT &amp;H3C9, 0<br />
OUT &amp;H3C9, 30<br />
OUT &amp;H3C9, 0<br />
<br />
OUT &amp;H3C8, 4 'Color 4 set to a brighter red<br />
OUT &amp;H3C9, 63<br />
OUT &amp;H3C9, 0<br />
OUT &amp;H3C9, 0<br />
<br />
BOARD 'Call to sub program<br />
a$ = INPUT$(1) 'Wait for a key press<br />
END<br />
<br />
DEFSNG A-Z<br />
SUB Answer<br />
    'A red square with a white game piece on it.<br />
END SUB<br />
<br />
DEFINT A-Z<br />
SUB BOARD<br />
<br />
    PAINT (0, 0), 2<br />
    LINE (7, 7)-(633, 473), 8, B<br />
    LINE (10, 10)-(629, 469), 8, B<br />
    LINE (118, 35)-(527, 444), 8, BF<br />
    LINE (118, 35)-(527, 444), 0, B<br />
    FOR x = 123 TO 473 STEP 50<br />
        Col = Col + 1<br />
        FOR y = 40 TO 390 STEP 50<br />
            Row = Row + 1<br />
            LINE (x, y)-(x + 50, y + 50), 14, B<br />
            IF (Col + Row) MOD 2 THEN Colr = 0 ELSE Colr = 4<br />
            PAINT (x + 12, y + 12), Colr, 14<br />
        NEXT y<br />
    NEXT x<br />
<br />
    CIRCLE (148, 65), 20, 15 '148:65 are top row, first column center.<br />
    PAINT (148, 65), 15<br />
    CheckerBOARD(1, 1) = CheckerBOARD(1, 1) + 20<br />
    CIRCLE (198, 65), 20, 9 '198:65 are top row, second column center, etc.<br />
    PAINT (198, 65), 9<br />
    CheckerBOARD(1, 2) = CheckerBOARD(1, 2) + 10<br />
<br />
END SUB</code></div></div>
    </div>
    
    
    <div class="post_meta" id="post_meta_1011">
        <!-- start: postbit_iplogged_hiden -->
IP Address: <a href="moderation.php?action=getip&amp;pid=1011" onclick="MyBB.getIP(1011); return false;">Logged</a>
<!-- end: postbit_iplogged_hiden -->
        <div class="float_right">
            
        </div>
    </div>
    <!-- start: postbit_editreason -->
<div class="editreason" id="editreason_1011_original" style="display: none;"><label for="editreason">Edit Reason:</label> <input type="text" class="textbox" style="margin: 6px 0;" name="editreason" size="40" maxlength="150" id="quickedit_1011_editreason_original" value="" /><br /></div>
<!-- end: postbit_editreason -->
</div>
<div class="post_controls">
    <div class="postbit_buttons author_buttons float_left">
        <!-- start: postbit_find -->
<a href="search.php?action=finduser&amp;uid=19" title="Find all posts by this user" class="postbit_find"><span>Find</span></a>
<!-- end: postbit_find -->
    </div>
    <div class="postbit_buttons post_management_buttons float_right">
        <!-- start: postbit_edit -->
<a href="editpost.php?pid=1011" id="edit_post_1011" title="Edit this post" class="postbit_edit postbit_mirage"><span>Edit</span></a>
<div id="edit_post_1011_popup" class="popup_menu" style="display: none;"><div class="popup_item_container"><a href="javascript:void(0)" class="popup_item quick_edit_button" id="quick_edit_post_1011">Quick Edit</a></div><div class="popup_item_container"><a href="editpost.php?pid=1011" class="popup_item">Full Edit</a></div></div>
<script type="text/javascript">
// <!--
    if(use_xmlhttprequest == "1")
    {
        $("#edit_post_1011").popupMenu();
    }
// -->
</script>
<!-- end: postbit_edit --><!-- start: postbit_quickdelete -->
<a href="editpost.php?pid=1011" onclick="Thread.deletePost(1011); return false;" id="quick_delete_1011" title="Delete this thread" class="postbit_qdelete postbit_mirage"><span>Delete</span></a>
<!-- end: postbit_quickdelete --><!-- start: postbit_quickrestore -->
<a href="editpost.php?pid=1011" onclick="Thread.restorePost(1011); return false;" id="quick_restore_1011" title="Restore this thread" class="postbit_qrestore"><span>Restore</span></a>
<!-- end: postbit_quickrestore --><!-- start: postbit_quote -->
<a href="newreply.php?tid=239&amp;replyto=1011" title="Quote this message in a reply" class="postbit_quote postbit_mirage"><span>Reply</span></a>
<!-- end: postbit_quote --><!-- start: postbit_multiquote -->
<a href="javascript:void(0)" onclick="Thread.multiQuote(1011); return false;" style="display: none;" id="multiquote_link_1011" title="Quote this post" class="postbit_multiquote postbit_mirage"><span id="multiquote_1011">Quote</span></a>
<script type="text/javascript">
//<!--
    $('#multiquote_link_1011').css("display", "");
// -->
</script>
<!-- end: postbit_multiquote -->
    </div>
</div>
</div>
<!-- end: postbit -->
    </div>
</td></tr>
        <tr>
            <td class="tfoot">
                <!-- start: showthread_search -->
    <div class="float_right">
        <form action="search.php" method="post">
            <input type="hidden" name="action" value="thread" />
            <input type="hidden" name="tid" value="239" />
            <input type="text" name="keywords" value="Enter Keywords" onfocus="if(this.value == 'Enter Keywords') { this.value = ''; }" onblur="if(this.value=='') { this.value='Enter Keywords'; }" class="textbox" size="25" />
            <input type="submit" class="button" value="Search Thread" />
        </form>
    </div>
<!-- end: showthread_search -->
                <div>
                    <strong>&laquo; <a href="showthread.php?tid=239&amp;action=nextoldest">Next Oldest</a> | <a href="showthread.php?tid=239&amp;action=nextnewest">Next Newest</a> &raquo;</strong>
                </div>
            </td>
        </tr>
    </table>
    <div class="float_left">
        
    </div>
    <div style="padding-top: 4px;" class="float_right">
        <!-- start: showthread_newreply -->
<a href="newreply.php?tid=239" class="button new_reply_button"><span>New Reply</span></a>&nbsp;
<!-- end: showthread_newreply -->
    </div>
    <br class="clear" />
    <!-- start: showthread_quickreply -->

<div id="quickreply_spinner" class="showthread_spinner" style="display: none"><img src="https://staging.qb64phoenix.com/images/spinner.gif" /></div>
<br />

<form method="post" action="newreply.php?tid=239&amp;processed=1" name="quick_reply_form" id="quick_reply_form">
    <input type="hidden" name="my_post_key" value="df919e65dd29001dfcf0d8c500636fad" />
    <input type="hidden" name="subject" value="RE: Checker Board - Checker Board Layout with Two Checkers and Mapping Routine." />
    <input type="hidden" name="action" value="do_newreply" />
    <input type="hidden" name="posthash" value="f6204076d049017fab5531b9631e1fb9" id="posthash" />
    <input type="hidden" name="quoted_ids" value="" id="quoted_ids" />
    <input type="hidden" name="lastpid" id="lastpid" value="1011" />
    <input type="hidden" name="from_page" value="1" />
    <input type="hidden" name="tid" value="239" />
    <input type="hidden" name="method" value="quickreply" />

    <table border="0" cellspacing="0" cellpadding="5" class="tborder">
        <thead>
            <tr>
                <td class="thead" colspan="2">
                    <div class="expcolimage"><img src="https://staging.qb64phoenix.com/images/collapse.png" id="quickreply_img" class="expander" alt="[-]" title="[-]" /></div>
                    <div><strong>Quick Reply</strong></div>
                </td>
            </tr>
        </thead>
        <tbody style="" id="quickreply_e">
            <tr>
                <td class="trow_shaded" valign="top" width="22%">
                    <strong>Message</strong><br />
                    <span class="smalltext">Type your reply to this message here.<br /><br />
                    <!-- start: showthread_quickreply_options_signature -->
<label><input type="checkbox" class="checkbox" name="postoptions[signature]" value="1" checked="checked" />&nbsp;<strong>Signature</strong></label><br />
<!-- end: showthread_quickreply_options_signature -->
                    <label><input type="checkbox" class="checkbox" name="postoptions[disablesmilies]" value="1" />&nbsp;<strong>Disable Smilies</strong></label><!-- start: showthread_quickreply_options_close -->
<br /><label><input type="checkbox" class="checkbox" name="modoptions[closethread]" value="1" checked="checked" />&nbsp;<strong>Close Thread</strong></label>
<!-- end: showthread_quickreply_options_close --><!-- start: showthread_quickreply_options_stick -->
<br /><label><input type="checkbox" class="checkbox" name="modoptions[stickthread]" value="1" />&nbsp;<strong>Stick Thread</strong></label>
<!-- end: showthread_quickreply_options_stick --></span>
                </td>
                <td class="trow_shaded">
                    <div style="width: 95%">
                        <textarea style="width: 100%; padding: 4px; margin: 0;" rows="8" cols="80" name="message" id="message" tabindex="1"></textarea>
                    </div>
                    <div class="editor_control_bar" style="width: 95%; padding: 4px; margin-top: 3px; display: none;" id="quickreply_multiquote">
                        <span class="smalltext">
                            You have selected one or more posts to quote. <a href="./newreply.php?tid=239&amp;load_all_quotes=1" onclick="return Thread.loadMultiQuoted();">Quote these posts now</a> or <a href="javascript:void(0)" onclick="Thread.clearMultiQuoted(); return false;">deselect them</a>.
                        </span>
                    </div>
                </td>
            </tr>
            
            <tr>
                <td colspan="2" align="center" class="tfoot"><input type="submit" class="button" value="Post Reply" tabindex="2" accesskey="s" id="quick_reply_submit" /> <input type="submit" class="button" name="previewpost" value="Preview Post" tabindex="3" /></td>
            </tr>
        </tbody>
    </table>
</form>
<!-- end: showthread_quickreply -->
    
    
    <br />
    <div class="float_left">
        <ul class="thread_tools">
            <!-- start: showthread_printthread -->
<li class="printable"><a href="printthread.php?tid=239">View a Printable Version</a></li>
<!-- end: showthread_printthread -->
            <!-- start: showthread_send_thread -->
<li class="sendthread"><a href="sendthread.php?tid=239">Send this Thread to a Friend</a></li>
<!-- end: showthread_send_thread -->
            <!-- start: showthread_subscription -->
<li class="subscription_add"><a href="usercp.php?action=addsubscription&amp;tid=239&amp;my_post_key=df919e65dd29001dfcf0d8c500636fad">Subscribe to this thread</a></li>
<!-- end: showthread_subscription -->
            
        </ul>
    </div>

    <div class="float_right" style="text-align: right;">
        <!-- start: showthread_moderationoptions -->
<!-- start: showthread_inlinemoderation -->
<script type="text/javascript" src="https://staging.qb64phoenix.com/jscripts/inline_moderation.js?ver=1821"></script>
<form action="moderation.php" method="post" style="margin-top: 0; margin-bottom: 0;" id="inlinemoderation_options">
<input type="hidden" name="my_post_key" value="df919e65dd29001dfcf0d8c500636fad" />
<input type="hidden" name="tid" value="239" />
<input type="hidden" name="modtype" value="inlinepost" />
<span class="smalltext"><strong>Inline Post Moderation:</strong></span>
<select name="action" id="inlinemoderation_options_selector">
<!-- start: showthread_inlinemoderation_standard -->
<optgroup label="Standard Tools">
    <!-- start: showthread_inlinemoderation_softdelete -->
<option value="multisoftdeleteposts">Soft Delete Posts</option>
<!-- end: showthread_inlinemoderation_softdelete -->
    <!-- start: showthread_inlinemoderation_restore -->
<option value="multirestoreposts">Restore Posts</option>
<!-- end: showthread_inlinemoderation_restore -->
    <!-- start: showthread_inlinemoderation_delete -->
<option value="multideleteposts">Delete Posts Permanently</option>
<!-- end: showthread_inlinemoderation_delete -->
    <!-- start: showthread_inlinemoderation_manage -->
<option value="multimergeposts">Merge Posts</option>
<option value="multisplitposts">Split Posts</option>
<option value="multimoveposts">Move Posts</option>
<!-- end: showthread_inlinemoderation_manage -->
    <!-- start: showthread_inlinemoderation_approve -->
<option value="multiapproveposts">Approve Posts</option>
<option value="multiunapproveposts">Unapprove Posts</option>
<!-- end: showthread_inlinemoderation_approve -->
</optgroup>
<!-- end: showthread_inlinemoderation_standard -->

</select>
<input type="submit" class="button" name="go" value="Go (0)" id="inline_go" />&nbsp;
<input type="button" class="button" onclick="inlineModeration.clearChecked();" value="Clear" />
</form>
<script type="text/javascript">
<!--
    var go_text = "Go";
    var all_text = "41";
    var inlineType = "thread";
    var inlineId = 239;

    $("#inlinemoderation_options_selector").on('change', function() {
        $("#inlinemoderation_options").trigger('submit');
    })
// -->
</script><br />
<!-- end: showthread_inlinemoderation -->
<form action="moderation.php" method="post" style="margin-top: 0; margin-bottom: 0;" id="moderator_options">
    <input type="hidden" name="modtype" value="thread" />
    <input type="hidden" name="tid" value="239" />
    <input type="hidden" name="my_post_key" value="df919e65dd29001dfcf0d8c500636fad" />
    <span class="smalltext">
    <strong>Moderation Options:</strong></span>
    <select name="action" id="moderator_options_selector">
        <option value="delayedmoderation">Delayed Moderation</option>
        <!-- start: showthread_moderationoptions_standard -->
<optgroup label="Standard Tools">
<!-- start: showthread_moderationoptions_threadnotes -->
<option value="threadnotes" selected="selected">Edit / View Thread Notes</option>
<!-- end: showthread_moderationoptions_threadnotes -->
<!-- start: showthread_moderationoptions_openclose -->
<option class="option_mirage" value="openclosethread">Open / Close Thread</option>
<!-- end: showthread_moderationoptions_openclose -->
<!-- start: showthread_moderationoptions_softdelete -->
<option value="softdeletethread">Soft Delete Thread</option>
<!-- end: showthread_moderationoptions_softdelete -->
<!-- start: showthread_moderationoptions_delete -->
<option value="deletethread">Delete Thread Permanently</option>
<!-- end: showthread_moderationoptions_delete -->

<!-- start: showthread_moderationoptions_stickunstick -->
<option class="option_mirage" value="stick">Stick / Unstick Thread</option>
<!-- end: showthread_moderationoptions_stickunstick -->
<!-- start: showthread_moderationoptions_manage -->
<option class="option_mirage" value="move">Move / Copy Thread</option>
<option class="option_mirage" value="split">Split Thread</option>
<option class="option_mirage" value="merge">Merge Threads</option>
<option class="option_mirage" value="removeredirects">Remove Redirects</option>
<option class="option_mirage" value="removesubscriptions">Remove All Subscriptions</option>
<!-- end: showthread_moderationoptions_manage -->
<!-- start: showthread_moderationoptions_unapprove -->
<option class="option_mirage" value="unapprovethread">Unapprove Thread</option>
<!-- end: showthread_moderationoptions_unapprove -->
</optgroup>
<!-- end: showthread_moderationoptions_standard -->
        
    </select>
    <!-- start: gobutton -->
<input type="submit" class="button" value="Go" />
<!-- end: gobutton -->
</form>
<br />
<script type="text/javascript">
<!--
    $("#moderator_options_selector").on('change', function() {
        $("#moderator_options").trigger('submit');
    })
//-->
</script>
<!-- end: showthread_moderationoptions -->
        <!-- start: forumjump_advanced -->
<form action="forumdisplay.php" method="get">
<span class="smalltext"><strong>Forum Jump:</strong></span>
<select name="fid" class="forumjump">
<option value="-4">Private Messages</option>
<option value="-3">User Control Panel</option>
<option value="-5">Who's Online</option>
<option value="-2">Search</option>
<option value="-1">Forum Home</option>
<!-- start: forumjump_bit -->
<option value="1" > QB64 Rising</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="3" >-- Code and Stuff</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="7" >---- Programs</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="8" >---- Utilities</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="9" >---- Works in Progress</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="10" >---- Help Me!</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="21" >-- Expanding Horizons (Libraries)</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="24" >---- One Hit Wonders</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="23" >---- RhoSigma</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="22" >---- SMcNeill</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="30" >---- Spriggsy</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="31" >---- Terry Ritchie</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="26" >-- Prolific Programmers</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="27" selected="selected">---- TheBOB</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="36" >---- bplus</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="33" >---- Pete</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="34" >---- Dav</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="28" >---- Keybone</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="32" >---- RhoSigma</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="29" >---- SMcNeill</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="11" > Chatting and Socializing</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="2" >-- General Discussion</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="37" >---- NSFW (18+)</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="35" >---- Freedom to Speak</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="12" >-- Site Suggestions</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="16" > Official Links</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="18" >-- Announcements</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="41" >-- QB64 Phoenix Edition Wiki and Repo</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="25" >---- Wiki Discussion</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="42" >---- Repo Discussion</option>
<!-- end: forumjump_bit --><!-- start: forumjump_bit -->
<option value="13" >-- Learning Resources and Archives</option>
<!-- end: forumjump_bit -->
</select>
<!-- start: gobutton -->
<input type="submit" class="button" value="Go" />
<!-- end: gobutton -->
</form>
<script type="text/javascript">
$(".forumjump").on('change', function() {
    var option = $(this).val();

    if(option < 0)
    {
        window.location = 'forumdisplay.php?fid='+option;
    }
    else
    {
        window.location = 'forumdisplay.php?fid='+option;
    }
});
</script>
<!-- end: forumjump_advanced -->
    </div>
    <br class="clear" />
    <!-- start: showthread_usersbrowsing -->
<br />
<span class="smalltext">Users browsing this thread: <a href="member.php?action=profile&amp;uid=19" title="Reading&hellip; (07:00 PM)"><span style="color: green;"><strong><em>Pete</em></strong></span></a></span>
<br />
<!-- end: showthread_usersbrowsing -->
    <!-- start: footer -->
<!-- start: debug_summary -->
<div id="debug">Generated in 15 ms (40.20% PHP / 59.80% MySQL) <br />SQL Queries: 27 / Server Load: 0 / Memory Usage: 2 MB<br />[<a href="/forum/showthread.php?tid=239&amp;debug=1" target="_blank">Advanced Details</a>]<br /></div>
<!-- end: debug_summary -->
    </div>
</div>
<div id="footer">
    <div class="upper">
        <div class="wrapper">
            
            <!-- start: footer_themeselect -->
<div class="theme">
<form method="POST" action="/forum/showthread.php" id="theme_select">
    <input type="hidden" name="tid" value="239" />

    <input type="hidden" name="my_post_key" value="df919e65dd29001dfcf0d8c500636fad" />
    <!-- start: footer_themeselector -->
<select name="theme" onchange="MyBB.changeTheme();">
<optgroup label="Quick Theme Select">
<!-- start: usercp_themeselector_option -->
<option value="2">Default</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="5">--Black</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="6">--Calm</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="7">--Dawn</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="8">--Earth</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="9">--Flame</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="10">--Leaf</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="11" selected="selected">--Night</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="12">--Sun</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="13">--Twilight</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="14">--Water</option>
<!-- end: usercp_themeselector_option --><!-- start: usercp_themeselector_option -->
<option value="4">Square</option>
<!-- end: usercp_themeselector_option -->
</optgroup>
</select>
<!-- end: footer_themeselector -->
    <!-- start: gobutton -->
<input type="submit" class="button" value="Go" />
<!-- end: gobutton -->
</form>
</div>
<!-- end: footer_themeselect -->
            <ul class="menu bottom_links">
                <!-- start: footer_showteamlink -->
<li><a href="showteam.php">Forum Team</a></li>
<!-- end: footer_showteamlink -->
                <!-- start: footer_contactus -->
<li><a href="https://staging.qb64phoenix.com/contact.php">Contact Us</a></li>
<!-- end: footer_contactus -->
                <li><a href="https://qb64phoenix.com/">QB64 Phoenix Edition</a></li>
                <li><a href="#top">Return to Top</a></li>
                <li><a href="https://staging.qb64phoenix.com/archive/index.php?thread-239.html">Lite (Archive) Mode</a></li>
                <li><a href="https://staging.qb64phoenix.com/misc.php?action=markread&amp;my_post_key=df919e65dd29001dfcf0d8c500636fad">Mark all forums read</a></li>
                <li><a href="https://staging.qb64phoenix.com/misc.php?action=syndication">RSS Syndication</a></li>
            </ul>
        </div>
    </div>
    <div class="lower">
        <div class="wrapper">
            <span id="current_time"><strong>Current time:</strong> 05-02-2022, 07:00 PM</span>
            <span id="copyright">
                <!-- MyBB is free software developed and maintained by a volunteer community.
                    It would be much appreciated by the MyBB Group if you left the full copyright and "powered by" notice intact,
                    to show your support for MyBB.  If you choose to remove or modify the copyright below,
                    you may be refused support on the MyBB Community Forums.

                    This is free software, support us and we'll support you. -->
                Powered By <a href="https://mybb.com" target="_blank" rel="noopener">MyBB 1.8.30</a>, &copy; 2002-2022 <a href="https://mybb.com" target="_blank" rel="noopener">MyBB Group</a>.
                <!-- End powered by -->
            </span>
        </div>
    </div>
</div>
<!-- The following piece of code allows MyBB to run scheduled tasks. DO NOT REMOVE --><!-- End task image code -->
<!-- start: global_dst_detection -->
<script type="text/javascript">if(MyBB) { $([document, window]).on("load", function() { MyBB.detectDSTChange('0'); }); }</script>
<!-- end: global_dst_detection -->
</div>
<!-- end: footer -->
    <script type="text/javascript">
        var thread_deleted = "0";
        if(thread_deleted == "1")
        {
            $("#quick_reply_form, .new_reply_button, .thread_tools, .inline_rating").hide();
            $("#moderator_options_selector option.option_mirage").attr("disabled","disabled");
        }
    </script>
    <script>
            document.querySelectorAll('.codeblock').forEach(codeblock => {
                codeblock.querySelector('.title').addEventListener('click', () => {
                    window.getSelection().selectAllChildren(codeblock.querySelector('code'));
                });
            });
    </script>



<style>
.Add this below your Select All JavaScript:

---------------------------------
<style>
.SelectAllHover {
    background-color: transparent;
}
.SelectAllHover:hover {
    background-color: blue;
}
</style>
---------------------------------

And...

CHANGE: Code: (Select All)

TO:

Code: <span class="SelectAllHover">(Select All)</span>
Add this below your Select All JavaScript:

---------------------------------
<style>
.SelectAllHover {
    background-color: transparent;
}
.SelectAllHover:hover {
    background-color: blue;
}
</style>
---------------------------------

And...

CHANGE: Code: (Select All)

TO:

Code: <span class="SelectAllHover">(Select All)</span>
SelectAllHover {
    background-color: transparent;
}
.SelectAllHover:hover {
    background-color: blue;
}
</style>


    
<script async type="text/javascript" src="jscripts/imgbb.js" charset="utf-8"></script>
</body>
</html>
<!-- end: showthread -->

Pete
Reply




Users browsing this thread: 5 Guest(s)