Poetry that Compiles

A General Discussion forum for TI calculators

Moderator: MaxCoderz Staff

Post Reply

Could this be a cool contest?

Hell yes!
12
67%
Don't think so
5
28%
I don't know
1
6%
 
Total votes: 18

User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Poetry that Compiles

Post by Timendus »

Code: Select all

	.include "Shakespeare.inc"
	

-Romeo:	At Juliet
	
	[ If I profane with my unworthiest hand ]
	[ This holy shrine, the gentle sin is this ]
	[ My lips, two blushing pilgrims, ready stand ]
	[ To smooth that rough touch with a tender kiss. ]

-Juliet:	Replies

	[ Good pilgrim, you do wrong your hand too much ]
	[ Which mannerly devotion shows in this ]
	[ For saints have hands that pilgrims hands do touch ]
	[ And palm to palm is holy palmers kiss. ]
	
-Romeo:

	[ Have not saints lips, ]
	[ and holy palmers too? ]

-Juliet:	Blushes

	[ Ay pilgrim, ]
	[ lips that they must use in prayer. ]
	
-Romeo:	Moving towards Juliet

	[ O! Then, dear saint, let lips do what hands do ]
	[ They pray, grant thou, lest faith turn to despair. ]

-Juliet:	Slightly backing away

	[ Saints do not move, though grant for prayers` sake. ]
	
-Romeo:

	[ Then move not, while my prayers` effect I take. ]
	[ Thus from my lips, by thine, my sin is purg`d. ]

-Juliet:	Gets kissed

	[ Then have my lips the sin that they have took. ]

-Romeo:

	[ Sin from my lips? O trespass sweetly urg`d! ]
	[ Give me my sin again. ]

-Juliet:

	[ You kiss by the book. ]
	
	Exeunt
Yes, with some help of Shakespeare.inc this actually does compile and manages to output itself :mrgreen:

Image

Perhaps making source code look cool or using poetry as source could be something for our next contest? We could judge on looks of the code (bonus for functional ASCII-art :P), and how much use the program has, perhaps relative to the code. And I reward a pulitzer prize to whoever rewrites Shakespeare.inc ;)
Last edited by Timendus on Fri 08 Dec, 2006 9:17 am, edited 1 time in total.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Post by kalan_vod »

Hmm, someone has a lot of time ;). I think you should've put this in the comp. forum though :P.
User avatar
DigiTan
Calc Master
Posts: 1069
Joined: Fri 04 Mar, 2005 12:52 am
Location: NW Wisconsin
Contact:

Post by DigiTan »

db or .db? That is the question.

I vote yes.
My diet consists of nails, code-stealers, and HP fans.
Projects:

Robot War [TI-82, TI Flash App]
Sonic the Hedgehog [Multiplatform]
User avatar
tr1p1ea
Maxcoderz Staff
Posts: 4141
Joined: Thu 16 Dec, 2004 10:06 pm
Location: I cant seem to get out of this cryogenic chamber!
Contact:

Post by tr1p1ea »

DigiTan wrote:db or .db? That is the question.

I vote yes.
Rofl! Nice Digitan :P.

An interesting project Timendus ... and so is 'aMazed' :).
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

DigiTan wrote:db or .db? That is the question.
:lol: :lol:
Image
threefingeredguy
Calc King
Posts: 2195
Joined: Sun 27 Mar, 2005 4:06 am
Location: sleeping
Contact:

Post by threefingeredguy »

I would have chosen "Yeah sure, why not?".
Image
Patori
Maxcoderz Staff
Posts: 1479
Joined: Sat 18 Dec, 2004 3:51 am
Location: Toledo, Ohio, USA

Post by Patori »

Hm... i think ive heard about a language like this somewhere...

like the place where i heard about brainf*ck and Cow...
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

This isn't a language... It's just plain assembly ;)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
Patori
Maxcoderz Staff
Posts: 1479
Joined: Sat 18 Dec, 2004 3:51 am
Location: Toledo, Ohio, USA

Post by Patori »

http://shakespearelang.sourceforge.net/ ... peare.html

That's what I was thinking of... Both are cool!!
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...
User avatar
Timendus
Calc King
Posts: 1729
Joined: Sun 23 Jan, 2005 12:37 am
Location: Netherlands
Contact:

Post by Timendus »

So, when is the contest due? We got 66% "Hell yes this would be a cool contest" votes :)

Anyway, I'm necroposting because I forgot to post Shakespeare.inc and I just ran into it. It's really ugly hacked-together code, but it does the job ;)

Code: Select all

; ===============================================================
; Required Headers
; ===============================================================

.include "Includes/headers.inc"

.define empty .include "empty.txt" \

.define At empty
.define Juliet empty
.define Moving empty
.define towards empty
.define Slightly empty
.define backing empty
.define Gets empty

.define Replies .module Convo2
.define Blushes .module Convo3
.define away .module Convo4
.define kissed .module Convo5

.define [ .db "
.define ] ",0 \
.define Exeunt .db 0

; ===============================================================
; Main entry point
; ===============================================================

main:

	ld hl,$0101
	ld (PENCOL),hl
	ld hl,Romeo_and_Juliet
dispLoop:
	push hl
	ld hl,(PENCOL)
	ld l,1
	ld (PENCOL),hl
	pop hl
	push hl
	call api_graph_print
	call api_graph_newline
	pop hl
searchLoop:
	ld a,(hl)
	inc hl
	or a
	jp nz,searchLoop
	
	ld a,(hl)
	or a
	jr nz,dispLoop

	bcall(_getkey)
	ret
	
api_graph_print:
   set   textwrite,(iy+SGRFLAGS)
api_graph_print_loop:
   ld   a,(hl)
   inc   hl
   or   a
   jp   z,ionFastCopy
   bcall(_vputmap)
   jr   nc,api_graph_print_loop

   ld   c,0
   push   hl
   dec   hl
api_graph_print_wrap:
   dec   hl

   push   hl      ; calculate width to remove
   ld   l,(hl)
   ld   h,8
   bcall(_htimesl)
   bcall(_sfont_len)
   pop   hl
   ld   a,c
   add   a,b
   ld   c,a

   ld   a,(hl)      ; go on untill space found
   cp   ' '
   jr   nz,api_graph_print_wrap

   ld   a,c      ; check if it's too wide to fit
   cp   60
   jr   c,api_graph_print_dowrap
   call   api_graph_newline
   pop   hl
   dec   hl
   jr   api_graph_print_loop

api_graph_print_dowrap:
   push   hl
   ld   hl,(PENCOL)
   ld   a,l
   sub   c
   ld   l,a
   ld   (PENCOL),hl
api_graph_print_wrap_loop:
   ld   a,' '
   bcall(_vputmap)
   jr   nc,api_graph_print_wrap_loop

   call   api_graph_newline
   pop   hl
   pop   de
   inc   hl
   jr   api_graph_print_loop
   
api_graph_newline:
   ld   hl,(PENCOL)
   ld   l,7
   ld   a,h
   add   a,6
   cp   60
   jr   nc,api_graph_newline_scrollup
   ld   h,a
   ld   (PENCOL),hl
   ret
api_graph_newline_scrollup:

   call ionFastCopy
   bcall(_getkey)
   
   ld   hl,plotsscreen
   ld   de,plotsscreen+1
   ld   bc,767
   xor   a
   ld   (hl),a
   ldir
   ld hl,(PENCOL)
   ld h,1
   ld (PENCOL),hl   
   ret
	
Romeo_and_Juliet:

.locallabelchar -
.module Convo1
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
User avatar
anykey
Extreme Poster
Posts: 420
Joined: Mon 31 Jan, 2005 3:36 am
Location: In the matrix
Contact:

Post by anykey »

Why hasn't anybody said anything about Perl poetry?
http://www.perlmonks.org/index.pl?node=Perl%20Poetry
Perl is perfect for poetry due to its confusing syntax and motto "there's more than one way to do it".
I think, therefore iMac
Image
Post Reply