Knight's Tour game in 30 lines of Javascript
Edit fiddle - JSFiddle - Code Playground

    
      
        Keep JSFiddle running.Whitelist us in your content blocker.

        
          We've been providing web developers, educators, students, companies with JSFiddle free for many years.
          Your can help us in one of two ways:
          
            Whitelist JSFiddle in your content blocker
            Go PRO and get access to additional PRO features →
          
        
      

      
    
    
    
  
    
      
        Join the 4+ million users, and keep the JSFiddle dream alive.

        
          
            
              
                
              
            
            
              Ad-free
              All ads in the editor and listing pages are turned completely off.
            
          
          
            
              
            
            
              Use pre-released features
              You get to try and use features (like the Palette Color Generator) months before everyone else.
            
          
          
            
              
                
                  
                  
                  
                  
                
              
            
            
              Fiddle collections
              Sort and categorize your Fiddles into multiple collections.
            
          
          
            
              
                
                  
                  
                
              
            
            
              Private collections and fiddles
              You can make as many Private Fiddles, and Private Collections as you wish!
            
          
          
            
              
                
                  
                  
                
              
            
            
              Console
              Debug your Fiddle with a minimal built-in JavaScript console.
            
          
        
      
      

    
    
  
    
      Color Palette Generator
      Generate a cool color palette with a few clicks
      
    
    
      
    
    
  
    
      Share or embed fiddle
      Customize the embeddable experience for websites
    
    
      
          
            Tabs:
            
                
                 JavaScript
              
              
                
                 HTML
              
              
                
                 CSS
              
              
                
                 Result
              
             
          

          
            Visual:
            
                
                 Light
              
              
                
                 Dark
              
             
            
          

          
            
              Embed snippet
              Prefer iframe?:
            
             

             
          
        
    
    
  
    
      Editor settings
      Customize the behavior and feel of the editor
    
    

      
        
          Behavior
          
            
                
                  
                  
                  Auto-run code
                
            
            
                
                  
                  
                  Only auto-run code that validates
                
            
            
                
                  
                  
                  Auto-save code
                
            
            
              
                
                
                Auto-close HTML tags
              
            
            
              
                
                
                Auto-close brackets
              
            
            
              
                
                
                Live code validation
              
            
            
              
                
                
                Highlight matching tags
              
            
            
              
                
                
                Hot reload CSS NEW
              
            
            
              
                
                
                Hot reload HTML NEW
              
            
           
        

        
          General
          
            
              
                
                
                Line numbers
              
            
            
              
                
                
                Wrap lines
              
            
            
              
                
                
                Indent with tabs
              
            
            
              
                
                
                Code hinting (autocomplete) 
              
            
           

           
        

        
          Console
          
            
              
                
                
                Console in the editor
              
            
            
              
                
                
                Clear console on run
              
            
           
        
       
    

    
  
    
      Your recent fiddles
      Recentry created fiddles, including ones created while logged out
      
    
    
      
    
    
  
    
      JSFiddle changelog
      A log of all the changes made to JSFiddle – big and small.
    
    
      
        
          New Your recent fiddles when logged out
          Saving a fiddle, even when you're logged out, will put it under the
            Your recent fiddles modal in the sidebar. They will eventually disappear (since they're anonymous),
            but now you'll have time to save them under your user after logging in.
        
        
          New Tailwind CSS
          Added Tailwind CSS to the list of precompilers - even though it's really HTML,
            you can activate it from the dropdown in the CSS panel. Tailwind CSS would be best used
            with HTML Hot-reload enabled.
        
        
          Update Code linting and formatting
          We've replaced the dated code linter and formatted with more modern ones: Stylelint and Prettier.
        
        
          New JSFiddle 3.0
          
            The 3.0 updates brings a lot of changes, most notably a modern UI refresh.
            There was an increadible amount of under-the-hood changes for the front-end,
            we've mostly moved away from pre-processors. The light/dark themes are using a modern light-dark() approach.
            The refactoring allows for more changes to be made in a spedier manner.
            
              In the new sidebar you can find our mini-apps (right now the Color Palette Generator)
              System theme follows your OS settings
              CSS Hot-reload - styles update immidietly as you type
              HTML Hot-reload (experimental) - update HTML immidietly as you type
              Results panel color follows the selected theme
              Title and description are now a single field
              Public Profile page is completelty redesigned and can be easily used as your code showcase
              Groups are now Collections and we have big plans for them
              Collections are completely redesigned
              Users can now add groups straight from the editor
            
          
        
        
          New Import fiddles as modules
          
            Import fiddle code into other fiddles with Modules and Imports.
            JS Modules: import [name] from '@jsfiddle/[username]/[fiddle].js'
            CSS Import: @import url('@jsfiddle/[username]/[fiddle].css')
            See how this works in this fiddle.
          
        
        
          Change Fiddle listing shows latest version
          The fiddle listings (Public, Private, Titled, etc) will now display latest versions instead
            of the ones saved as Base versions - this was causing more confusion than good, so we decided
            to change this long-standing behavior.
        
        
          Change Evaluate code into the console
          Custom Console beta is getting more stable and feature-rich. Just added the ability to evaluate code in the console.
        
        
          New Console in the editor
          
            Introducing the first beta of the editor console - it's going to show you logs, warnings, errors without the need of opening full devtools.
            Console is avaialble for all users during beta, after that it'll be available for JSFiddle supporters.
          
        
        
          New More user's social links (Dev.to, Stack Overflow, Medium)
          You can add more of your social links `Settings / Social Media`, for Dev.to, Stack Overflow and Medium.
            These will be displayed on the profile section in Editor's sidebar and your public profile.
        
        
          Change Refactored Unsaved Drafts feature
          Unsaved drafts feature is completely rewritten with 100% fewer bugs and 10x more maintainable codebase – as the author of the previous one, I had hard times figuring out what it does 🥴
        
      
    

    
  
    
      Add a new collection
      Collect your fiddles in collections
      
    
    
      
    
    
  