This is an implementation of The Knight's Tour problem/solution in JavaScript.
To run:
node tour.js| <!DOCTYPE html> | |
| <html lang="en"> | |
| <!-- | |
| A sample framework for the ESA-NASA WebWorldWind web applications. | |
| Author: Bruce Schubert | |
| License: MIT | |
| See: https://worldwind.arc.nasa.gov/web/ | |
| --> | |
| <head> | |
| <meta charset="utf-8"> |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>JavaScript Countdown</title> | |
| <style> | |
| body { | |
| background-color: #383838; |
| package net.viralpatel.servlets; | |
| import java.io.IOException; | |
| import java.io.PrintWriter; | |
| import javax.servlet.ServletException; | |
| import javax.servlet.http.HttpServlet; | |
| import javax.servlet.http.HttpServletRequest; | |
| import javax.servlet.http.HttpServletResponse; |
| // Get references to page elements | |
| const passwordModal = document.querySelector('.modal'); | |
| const passwordInput = document.querySelector('.modal input'); | |
| const unlockBtn = document.querySelector('.modal button'); | |
| const notesSection = document.querySelector('.notes'); | |
| // Open password modal | |
| function openPasswordModal() { | |
| passwordModal.style.display = 'flex'; | |
| } |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Screen recorder</title> | |
| </head> | |
| <body> | |
| <button id="recording-toggle">Start recording</button> | |
| <script defer> |
| <html> | |
| <head> | |
| <style> | |
| #header{ | |
| background-color: lightblue; | |
| width:100%; | |
| height:50px; | |
| text-align: center; | |
| } |
| import com.pi4j.io.gpio.GpioController; | |
| import com.pi4j.io.gpio.GpioFactory; | |
| import com.pi4j.io.gpio.GpioPinDigitalOutput; | |
| import com.pi4j.io.gpio.PinState; | |
| import com.pi4j.io.gpio.RaspiPin; | |
| public class TrafficLights { | |
| private static GpioController gpio = null; | |
| private static GpioPinDigitalOutput red = null; | |
| private static GpioPinDigitalOutput yellow = null; |
| const timer = { | |
| pomodoro: 25, | |
| shortBreak: 5, | |
| longBreak: 15, | |
| longBreakInterval: 4, | |
| sessions: 0, | |
| }; | |
| let interval; |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Sine Wave</title> | |
| <script type="text/javascript"> | |
| function showAxes(ctx,axes) { | |
| var width = ctx.canvas.width; | |
| var height = ctx.canvas.height; | |
| var xMin = 0; |