# 
#                     The Land of Delicursion
#                    ---------------------------
# 	  http://freaknet.org/alpt/src/misc/delicursion.py
# 
# 
# This text is both a history of the remote land of Delicursion and the Key
# to access to any of its mesmerizing places.
# 
# Let thou be warned first: no stack-less people have ever crossed the gate of
# Delicursion!
# 
# ** History
# 
# As everything that has no end and beginning, Delicursion was there,
# unexplored and untamed. Free in its vast hash space...
# 
# ...until a day, when the first human step tasted its infinite ground. 
# It was the year 2003.
# 
# 
# In 05, two years later the discovery of Delicursion, many pilgrims
# began to visit its peaks. The journey was long but pleasant. 
# It was not rare that a pilgrim, inspired by the continuous, yet
# discrete, land, reached a deep insight on the structure of Delicursion.
# To thank the gods, the pilgrim would then leave a sign as a
# comfort and aid to the future visitors of the land.
# Drop by drop the signs cumulated. It was a pleasure travelling in
# Delicursion! How many wonderful stories were written on those signs.
# 
# In these days, everyone knows how the humans reached, by a fortunate twist of
# fate, Delicursion. But, for your serenity, I won't indulge to describing
# the early events.
# 
# It all started from a simple need of curiosity: 
#        http://del.icio.us/url/46efc577b7ddef30d1c6fd13311b371e   (1)
# The first timid step was posed by Deusx when he, the first, created (1)
# in September 2003.
# None was aware that the gate to Delicursion had been opened!
# 
# Only in February 04 Kokeshi bookmarked (1), thus generating
#        http://del.icio.us/url/9a81616a6fdc3fd6cd432f0c3cce9b5c    (2)
# The first stone on the stack had been posed!
# 
# In November 04, Panic bookmarked (2), thus generating (3).
# From this point on, it isn't clear who bookmarked what and when, because 
# many adventurers climbed well beyond the first 10 natural numbers,
# careless of what lied below.
# 
# During the years, a legend arose. It was the Legend of the Collision.
# The legend told: <<there exists the Secret Peak, which shall not be revealed to
# humans. The Secret Peak is the end and edge of the world. Whatever crosses its
# border will return to the Zero, the Origin of everything.>>
# However I shall be honest with you: there is another version of the Legend
# which claims that the Secret Peak is a gate not to the Origin, but to an
# unknown, yet known, peak of Delicursion.
# 
# It is also rumored that the reacher of the Peak, will be able to know and
# control the entire Delicursion.
# And this is the reason why many fools set forth to reach the Peak! They are
# not moved by the compassion of Delicursion, but by their greed!
# 
# This is, as the time of writing, the short, and by no way comprehensive, 
# history of Delicursion.
# 
# What follows are the modern times.
# To let you, the reader, know the actual state of things, I'll tell what
# I've discovered in my researches.
# 
# In December 07, I asked the Dragon Keeper what was the last peak
# reached. He answered:
#       <<That fools of humans have reached the 150th peak.
#         But BEWARE, they will never reach the Collision.>>
# With my modest telescope I checked the 150th peak: a consumed sign was
# there! It read: 
#        
#     ________________________
#    /\                       \
#    \_|   Hello...?           |
#      |                       |
#      |      - Waywardoctagon |
#      |   ____________________|_
#       \_/_____________________/
# 
# 
# Truly a human reached the 150th peak!
# 
# ** The Key
# 
# It was not with surprise that I discovered how simple was to build the Key.
# What led to the right choice of material was the number 33: the letters of
# each name of the peaks. Thus md5, the black, yet light, metal was chosen.
# At first, I inspected the names: how would they be written in the language of
# Delicursion? This answer was not easy to acquire.
# After many years of experiments, I finally found that the bare ASCII language of
# the middle age was the one!
# Thus I wrote the spell.
# The night of the final experiment I could not rest. Could the spell really
# predict the names of the peaks? Could the names really be so powerful to let
# you be _there_ just by pronouncing them?
# 
# Yes, it was true. And as a proof I marked the 1000th Peak.
# 
# To thanks the gods of this finding, and to let the future pilgrims be in
# comfort, I will share with you the spell.
# 
# Write with care the words that follow in a clean scroll.
# Let the scroll rest in a nest of pythons, and pray the goddess of
# computing.
# 
# Shall the Hashes Virtues be with you!
#
#  
# **** Usage of the Key
#
# python delicursion.py [N | [min max]]
#
# **** Examples of invocations
#
# python delicursion.py 100     # shows the 100-th hash
#
# python delicursion.py 1 101   # shows the first 100 hashes
#
# 
# --
# AlpT (@freaknet.org)
# Sat Dec 15 04:00:04 CET 2007
#

from sys import argv
from md5 import md5

if len(argv) >= 2:
        min=int(argv[1])
if len(argv) == 2:
        max=min+1
elif len(argv) == 3:
        max=int(argv[2])
else:
        min=0
        max=2048

ss=s='http://del.icio.us/'
for i in xrange(0,max):
        s=ss+'url/'+md5(s).hexdigest()
        if i+1 >= min and i+1 < max:
                print i+1,s


# ** The Dragon Keeper
# 
# This is the way to ask the Dragon Keeper in the ancient KornZshBashish
# language:
#
#thestart=1
#theneverend=1001
#for ((i=$thestart;i < $theneverend; i++)); do 
#    if lynx `python delicursion.py $i` -dump | grep -qi 'first posted by'; then
#        echo Someone is at peak $i
#    fi; 
#    sleep 0.5
#done
