Thursday, 22 November 2012

Python GUI Snippet

An example of a Hello World GUI snippet using Python programming language;-

#! /usr/local/bin/python
from Tkinter import *
root = Tk()
w = Label(root, text="Hello, World!\n")


Friday, 9 November 2012

Towers of Hanoi

The Towers of Hanoi is one of the classic problem every budding computer scientist must grapple with. Legend has it that in a temple in the Far East, priests are attempting to move a stack of golden disks from one diamond peg to another. The initial stack has 64 disks threaded onto one peg and prearranged from bottom to top by decreasing size. The priests are attempting to move the stack from one peg to another under the constraints that exactly one disk is moved at a time and at no time may a larger disk be placed above a smaller disk. Three pegs are provided, one being used for temporarily holding disks. Supposedly, the world will end when the priests complete their task.