arimbun

Pathfinder 2.0 released

Tags: ,

Pathfinder 2.0 is the latest update to the original Pathfinder, an artificial intelligence bot written in Python which is capable of traveling through a maze between two specific points. Version 2.0 incorporates a graphical user interface (GUI) and the removal of user interaction via the command prompt. This new interactive GUI allows user to:

  1. Resize the maze anywhere from 8×8 to 16×16.
  2. Specify forbidden nodes, start node and end node anywhere within the maze.
  3. Select one of the five available algorithms for use with path searching.
  4. View the resulting path from start to goal on a given maze display window.

Source code may be downloaded from within my GitHub repository. Critics and suggestions welcome.

Useful Vim configurations

Tags: ,

For those with preference for Vim command line text editor for their programming tasks, there’s a few settings that you can tweak to enhance its usability. The config file is usually located in /usr/share/vim/vimrc on Linux and Mac machines, unto which you can add the following lines:

syntax on

This turns on syntax highlighting. This is default on Ubuntu, but Mac users (as of Snow Leopard) will need to add this manually.

set number

This turns on line numbering, which is essential for programmers.

set smartindent
set autoindent

As you may have guessed, this spices up Vim’s indentation a little bit. I’ve noticed that they prevent the cursor from returning to the start of a line when the Return key is pressed. There are also other indenting options, such as cindent, but I find it particularly annoying and never used it.

set shiftwidth=4
set tabstop=4

These set tabstops every 4 characters, which is standard for most programming languages. You may substitute it with other values if preferred.

augroup vimrc_autocmds
  au!
  autocmd BufRead * highlight OverLength ctermbg=red ctermfg=white guibg=#592929
  autocmd BufRead * match OverLength /\%81v.*/
augroup END

This is a temporary solution to the right margin problem with Vim written by cyrilrbt as Vim does not support displaying right side margin. When these 5 lines are added, Vim will highlight the 81st character onwards with the colour scheme of an error message (white font on red background).

Restart Vim and all changes should take effect immediately.

© 2010 arimbun

Powered by Wordpress and Magatheme