Constellation Finder Icon

Constellation Finder

The following recipe demonstrates the use of SETs in Python.

Constellation FinderOverview

The following recipe demonstrates the use of SETs in Python. The scenario that this was written for is as follows:

A Star map is given according to the format X,Y,Z|...|X,Y,Z: X represents the X coordinate of the star (which may be any real integer). Y represents the Y coordinate on the star (which may be any real integer). Z represents the color of the star (which may be any real integer larger than 0). | separates the stars (strings represented by X,Y,Z). , separates the numbers describing the stars (X,Y,Z). : represents the end of the star map. ... is an arbitrary number of X,Y,Z strings with appropriate pipes.

As an extention to the original problem that this code was written for, Constellation definitions can follow the colon. The constellation String that might follow is described by the following:

:C!D#...#D|...|C!D#...#D : represents the beginning of the constellation definitions. C!D#...#D represents one constellation definition. | is the constellation definition separator. C is a number that identifies what constellation is being defined. D can be repesented as X,Y;X,Y or X,Y. X would be the X coordinate of a star defined in the star map. Y would be the Y coordinate of a star defined in the star map. , would be the coordinate separator. ; would be the star separator. ... would be an arbitrary number of D string with appropriate # signs. ... would be an arbitrary number of constellation definitions.

NEW

Fixed some bugs.

Constellation FinderInformation

Version
N/A
Date
03.05.10
License
Language
English
File Size
N/A
Category
SubCategory
Operating Systems
Windows ,Linux,Mac OS,BSD,Solaris
System Requirements
No additional system requirements.
Profile Cleanup Icon
Specify but is used here primarily to cleanup a profile in Windows.
Free
Schedule Maker Icon
Schedule Maker is designed to create schedules once was given a valid informatio
Example For winreg Icon
This recipe is another example of how to use the winreg module.
Encrypting A String Icon
The main purpose of these functions are to encrypt and decrypt a string
Artificial Windows Icon
There are probably other, better ways of printing ASCII graphics in Python
Free
A simple date class Icon
This recipe can be used by anyone who wants a date object for a program
Free
ZChat Icon
Provide an example of how the z_service module can be used.
Port Forwarding Icon
The title of this recipe contains the two words that gave the inspiration
More
Principal Component Analysis (PCA) Icon
A class that carries out Principal Component Analysis (PCA).
Free
Deal Or No Deal Game Icon
A game based on the tv game show, Deal Or No Deal.
Free
Disk Dumper Icon
This recipe will display a hex dump of the disk specified on the command line.
Complex Boolean Regular Expression Class Icon
Need to look for the occurence of words in a string or group of words
Free
Display an Image from a specified file Icon
Reads an image file from the filename specified as the 1st parameter
Free
Quickslice decorator Icon
Quickslice decorator script defines a decorator that allows for an abbreviated
Free
mx.ODBC example Icon
mx.ODBC example script shows you how to get the columns of a table and get data.
Free
Python replacement for java.util.Properties Icon
Quick and easy way to process Java properties files using pure Python
Free
More