There’s a chess board of size
Knight can step by going forward or backward two units in one direction, and one units in the other direction.
Find a way to position
| #!/bin/bash | |
| # run it with sudo | |
| # https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04 | |
| SWAPFILE=/swapfile | |
| SWAPSIZE=$1 | |
| ls $SWAPFILE && swapoff $SWAPFILE && rm $SWAPFILE | |
| fallocate -l $SWAPSIZE $SWAPFILE | |
| chmod 600 $SWAPFILE |
| require 'json' | |
| require 'yaml' | |
| input_filename = ARGV[0] | |
| output_filename = input_filename.sub(/(yml|yaml)$/, 'json') | |
| input_file = File.open(input_filename, 'r') | |
| input_yml = input_file.read | |
| input_file.close |
| # This file provide two pandoc filters for html and pdf output | |
| module Nanoc::Filters | |
| class PandocHtml < Nanoc::Filter | |
| identifier :pandoc_html | |
| type :text => :text | |
| def run(content, params = {}) | |
| input_format = case item[:extension] |
| #!/usr/bin/env ruby | |
| require 'optparse' | |
| require 'pry' | |
| def main | |
| options = {to_encoding: 'utf-8'} | |
| option_parser = OptionParser.new do |opts| | |
| executable_name = File.basename($PROGRAM_NAME) |
| (add-to-list 'load-path "~/.emacs.d/el-get/el-get") | |
| (unless (require 'el-get nil 'noerror) | |
| (with-current-buffer | |
| (url-retrieve-synchronously | |
| "https://raw.github.com/dimitri/el-get/master/el-get-install.el") | |
| (let (el-get-master-branch | |
| el-get-install-skip-emacswiki-recipes) | |
| (goto-char (point-max)) | |
| (eval-print-last-sexp)))) |