CINXE.COM
The Nim Number Game
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html lang="en-us"><head><script async src="https://www.googletagmanager.com/gtag/js?id=G-3SJLGKR77H"></script><script>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-3SJLGKR77H');</script><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><meta name="keywords" content="math games,logic games,numbers,games,educational games,games for kids,games for children,games for learning"><meta name="description" content="A numerical game of logic!"><meta http-equiv="pics-label" content='(PICS-1.1 "http://www.classify.org/safesurf/" l gen true for "http://education.jlab.org/" r (SS~~000 1))'><meta name="robots" content="index,all"><link rel="STYLESHEET" type="text/css" href="/css/main.css"><link rel="STYLESHEET" type="text/css" href="/css/nim.css"><link rel="STYLESHEET" type="text/css" href="/css/gameextra.css"><title>The Nim Number Game</title><script type="text/javascript"> <!-- if(self!=top){if(document.images)top.location.replace(window.location.href);else top.location.href=window.location.href;}ready_button=new Image(219,21);img_0=new Image(219,21);img_0.src="/g/checkbox-hover.gif";img_0.src="/g/ready-hover.gif";b__0=new Image(20,14);b__1=new Image(20,14);var b_j=new Array("s",".");function a_a(a_i,a_j,a_k,a_l,a_m,a_n){document.cookie=a_i+"="+escape(a_j)+((a_k)?"; expires="+a_k.toGMTString():"")+((a_l)?"; path="+a_l:"")+((a_m)?"; domain="+a_m:"")+((a_n)?"; secure":"");}function a_b(a_i){var a_c=a_i+"=";var a_d=a_c.length;var a_e=document.cookie.length;var a_f=0;while (a_f<a_e){var a_g=a_f+a_d;if(document.cookie.substring(a_f,a_g)==a_c){var a_h=document.cookie.indexOf(";",a_g);if(a_h==-1){a_h=document.cookie.length;}return unescape(document.cookie.substring(a_g,a_h));}a_f=document.cookie.indexOf(" ",a_f)+1;if(a_f==0){break;}}return null;}function a_o(img_tag_id,image_path){document.getElementById(img_tag_id).src=eval(img_tag_id+".src='"+image_path+"'");}function simple_toggle(some_button,mouseover_flag){var new_source=some_button.src.replace(/-hover/g,"");if(mouseover_flag==1){new_source=new_source.replace(/\.gif/,"-hover.gif");}a_o(some_button.id,new_source);}function c_a(box_number,box_value){for(i=0;i<b_j.length;i++){b_j[i]=".";a_o("b__"+i,"/g/checkbox.gif");}b_j[box_number]=box_value;a_o("b__"+box_number,"/g/checkbox-on.gif");return;}function b_v(){var string_for_cookie="just_a_test";a_a("NIM_DATA",string_for_cookie,null,"/");var cookie_check=a_b("NIM_DATA");if(cookie_check==string_for_cookie){if(b_j[0]=='s'){window.location.href="s_index.html";}else{window.location.href="c_index.html";}}else{alert("The data cookie could not be written! Make certain that your browser is accepting cookies and try again.");return false;}}function toggle_checkbox(button_id,mouseover_flag){var some_button=document.getElementById(button_id);if((some_button.src.indexOf("-on")==-1)){simple_toggle(some_button,mouseover_flag);}} // --> </script></head><body> <div class="topnav" id="myTopnav"> <a href="/index.html" title="JLab Science Education Home"><img src="/g/scied_logo_sm.png" alt="Science Education Home"></a> <a href="/index.html" title="JLab Science Education Home">Home</a> <a href="/indexpages/teachers.html" title="Teacher Tools">Teachers</a> <a href="/indexpages/" title="Student Zone">Students</a> <a href="/indexpages/elementgames.html" title="Games and Puzzles">Games</a> <a href="/indexpages/science_videos.html" title="Science Videos">Videos</a> <a href="/solquiz/" title="Virginia Standards of Learning Practice Tests">VA SOL</a> <a href="/indexpages/program.html" title="Programs and Events">Programs</a> <div class="search-container"> <form action="/search/"> <input type="text" placeholder="Search..." name="q"> <button type="submit"><i class="fa fa-search"></i></button> </form> </div> <a href="javascript:void(0);" class="icon" title="Menu" onclick="navToggle();"> <i class="fa fa-bars"></i> </a> </div> <!-- top navigation end --> <!-- 'main' section start --> <div class="main"> <div class="content"><div id="titleimg"><img src="title.gif" width="293" height="27" alt="The Nim Number Game"></div><h1 id="subtitle">Welcome to Nim!</h1><p class="txt">Nim is a game of logic and strategy. The goal of Nim is to be the player who removes the last of ten protons from the computer screen. A player must remove one or two protons during their turn. The player who removes the last proton wins.</p><noscript><p>If you are reading this, your browser is <strong>NOT</strong> running JavaScript.<br>JavaScript <strong>MUST</strong> be enabled for this section of our site to work.<br>Once you have turned JavaScript on, <a href="/solquiz/">reload this page</a><br>and this warning will go away.</p></noscript><div class="selectionboxcontainer"><table class="selectiontable"><tr class="selectiontitle"><td>Choose Your Opponent!</td></tr><tr class="selectionline"><td><p><a href="javascript:c_a(0,'s');"><img src="/g/checkbox-on.gif" width="20" height="14" alt="The Computer" id="b__0" onmouseover="javascript:toggle_checkbox('b__0','1');" onmouseout="javascript:toggle_checkbox('b__0','0');"></a><a href="javascript:c_a(0,'s');" onmouseover="javascript:toggle_checkbox('b__0','1');" onmouseout="javascript:toggle_checkbox('b__0','0');">The Computer</a></p><p><a href="javascript:c_a(1,'c');"><img src="/g/checkbox.gif" width="20" height="14" alt="A Classmate" id="b__1" onmouseover="javascript:toggle_checkbox('b__1','1');" onmouseout="javascript:toggle_checkbox('b__1','0');"></a><a href="javascript:c_a(1,'c');" onmouseover="javascript:toggle_checkbox('b__1','1');" onmouseout="javascript:toggle_checkbox('b__1','0');">A Classmate</a></p></td></tr></table></div><div id="startbutton"><a href="javascript:b_v();"><img src="/g/ready.gif" width="219" height="21" alt="Ready!" id="ready_button" onmouseover="javascript:simple_toggle(this,'1');" onmouseout="javascript:simple_toggle(this,'0');"></a></div> <!-- citation and page contact --> <div class="row page-contact"> <div class="col-12"> <p><a href="/faq/index.html">Citation and linking information</a></p> <p>For questions about this page, please contact <a href="mailto:carolm@jlab.org">Carol McKisson</a>.</p> </div> </div> <!-- end citation and page contact --> </div> <!-- ^^ end of 'content' div ^^ --> </div> <!-- 'main' section end --> <!-- footer start --> <div class="footer"> <div class="jlab-footer-background"> <div class="jlab-footer-content clearfix"> <!-- right section, containing lab address and links --> <div class="jlab-footer-right-container"> <p class="address">Thomas Jefferson</p> <p class="address">National Accelerator Facility</p> <div class="scied-lower-box"> <p class="address2">OFFICE OF SCIENCE EDUCATION</p> <p class="address2">628 Hofstadter Road, Suite 6<br>Newport News, VA 23606</p> <p class="scied-contact"><a href="mailto:surles@jlab.org">CONTACT US</a></p> </div> </div> <!-- ^^ right section end ^^ --> <!-- left section, containing divisional menus --> <div class="jlab-footer-left-container"> <div class="jl-col-1 jlab-footer-left-content clearfix"> <div class="jl-col-1 jlab-footer-resources"> <p><a href="https://www.jlab.org/">Jefferson Lab Resources</a></p> </div> <div class="jl-col-4 jlab-footer-left-links jl-smaller-screens"> <h2><a href="https://www.jlab.org/about">For The Public</a></h2> <ul> <li><a href="https://www.jlab.org/human_resources/diversity/">Diversity</a></li> <li><a href="https://www.jlab.org/eic/">Electron-Ion Collider</a></li> <li><a href="https://careers.peopleclick.com/careerscp/client_jeffersonlab/external/search.do?functionName=getSearchCriteria">Job Openings</a></li> <li><a href="https://www.jlab.org/pressroom/newsarchives/">News</a></li> <li><a href="https://www.jlab.org/pressroom/">Press Room</a></li> <li><a href="https://www.jlab.org/research/">Research Highlights</a></li> <li><a href="https://www.jlab.org/visiting/">Visiting</a></li> </ul> </div> <div class="jl-col-4 jlab-footer-left-links jl-smaller-screens"> <h2><a href="https://www.jlab.org/scientists/">For Researchers</a></h2> <ul> <li><a href="https://www.jlab.org/accelerator/">Accelerator Science</a></li> <li><a href="https://www.eiccenter.org/">EIC Center</a></li> <li><a href="https://www.jlab.org/eic-partner-project/">EIC Partner Project</a></li> <li><a href="https://www.jlab.org/engineering/">Engineering</a></li> <li><a href="https://www.jlab.org/physics/">Nuclear Physics</a></li> <li><a href="https://www.jlab.org/IT/Publications/">Publications</a></li> <li><a href="https://www.jlab.org/theory/">Theory Center</a></li> <li><a href="https://www.jlab.org/physics/user-liaison/">User Information</a></li> </ul> </div> <div class="jl-col-4 jlab-footer-left-links jl-smaller-screens"> <h2><a href="https://education.jlab.org/">For Education</a></h2> <ul> <li><a href="/indexpages/elementgames.html">Games & Puzzles</a></li> <li><a href="https://gspda.jlab.org/wiki/index.php/Main_Page/">Postdoc/Grad Students</a></li> <li><a href="/indexpages/program.html">Programs & Events</a></li> <li><a href="/indexpages/science_videos.html">Science Cinema</a></li> <li><a href="/indexpages/">Student Zone</a></li> <li><a href="/indexpages/teachers.html">Teacher Tools</a></li> </ul> </div> <div class="jl-col-4 jlab-footer-left-links jl-smaller-screens"> <h2><a href="https://www.jlab.org/business-services/">For Business</a></h2> <ul> <li><a href="https://www.jlab.org/about/communityimpact/">Community Impact</a></li> <li><a href="https://www.jlab.org/eshq/emergmgt/">Emergency Preparedness</a></li> <li><a href="https://www.jlab.org/about/comms/eventservices/">Event Services</a></li> <li><a href="https://www.jlab.org/partnerships">Partnerships</a></li> <li><a href="https://misportal.jlab.org/mis/staff/staffsearch.cfm">Phone Book</a></li> <li><a href="https://www.jlab.org/finance/procurement/">Procurement</a></li> <li><a href="https://www.jlab.org/finance/procurement/smallbusiness/">Small Business Program</a></li> <li><a href="https://www.jlab.org/techtransfer/">Technology Transfer</a></li> </ul> </div> </div> <!-- ^^ end 'jlab-footer-left-content' div ^^ --> <div class="jl-col-1 jlab-footer-left-bottom"> <p>Thomas Jefferson National Accelerator Facility is managed by</p> <p>Jefferson Science Associates, LLC for the U.S. Department of Energy</p> </div> </div> <!-- ^^ left section end ^^ --> </div> <!-- ^^ end 'jlab-footer-content' div ^^ --> </div> <!-- ^^ end jlab-footer-background ^^ --> </div> <!-- footer end --></body></html>