Skip to content

Instantly share code, notes, and snippets.

@relrod
Created January 22, 2010 01:29
Show Gist options
  • Select an option

  • Save relrod/283420 to your computer and use it in GitHub Desktop.

Select an option

Save relrod/283420 to your computer and use it in GitHub Desktop.
/********************************************************************
* This C program was generated by spl2c, the Shakespeare to C *
* converter by Jon Åslund and Karl Hasselström. *
********************************************************************/
/* libspl definitions and function prototypes */
#include <spl.h>
int main(void)
{
/******************************************************************
* THE INFAMOUS HELLO WORLD PROGRAM IN SHAKESPEARE *
******************************************************************/
CHARACTER *romeo; /* a young man with a remarkable patience */
CHARACTER *juliet; /* a likewise young woman of remarkable grace */
CHARACTER *ophelia; /* a remarkable woman much in dispute with Hamlet */
CHARACTER *hamlet; /* the flatterer of Andersen Insulting A / S */
int comp1, comp2;
global_initialize();
romeo = initialize_character("Romeo");
juliet = initialize_character("Juliet");
ophelia = initialize_character("Ophelia");
hamlet = initialize_character("Hamlet");
act_i: /* Hamlet ' s insults and flattery */
act_i_scene_i: /* The insulting of Romeo */
enter_scene(13, hamlet);
enter_scene(13, romeo);
activate_character(30, hamlet);
assign(16, second_person, 2*2*2*2*2*2*(-1));
assign(18, second_person, int_sub(17, 2*2*2*1, value_of(18, second_person)));
char_output(18, second_person);
assign(22, second_person, int_add(20, 2*2*2*2*2*2*2*(-1), 2*2*2*2*2*1));
assign(23, second_person, int_sub(22, int_add(22, 2*2*1, 1), value_of(23, second_person)));
char_output(23, second_person);
assign(26, second_person, int_add(25, value_of(25, second_person), int_sub(26, 2*2*2*1, 1)));
char_output(26, second_person);
char_output(28, second_person);
exit_scene(30, romeo);
act_i_scene_ii: /* The praising of Juliet */
enter_scene(34, juliet);
activate_character(40, hamlet);
assign(38, second_person, int_add(37, int_add(37, romeo->value, 1), 2*1));
char_output(38, second_person);
exit_scene(40, juliet);
act_i_scene_iii: /* The praising of Ophelia */
enter_scene(44, ophelia);
activate_character(54, hamlet);
assign(48, second_person, int_mul(47, 2*2*1, 2*2*2*1));
char_output(48, second_person);
assign(51, second_person, int_mul(50, 2*2*2*1, int_add(51, 1, 2*1)));
assign(52, second_person, int_sub(52, juliet->value, value_of(52, second_person)));
char_output(52, second_person);
exit_scene(54, ophelia);
exit_scene(54, hamlet);
act_ii: /* Behind Hamlet ' s back */
act_ii_scene_i: /* Romeo and Juliet ' s conversation */
enter_scene(61, romeo);
enter_scene(61, juliet);
activate_character(68, romeo);
char_output(64, second_person);
assign(65, second_person, int_add(64, value_of(64, second_person), int_sub(65, 2*2*1, 1)));
char_output(66, second_person);
activate_character(74, juliet);
char_output(69, second_person);
assign(69, second_person, hamlet->value);
assign(72, second_person, int_sub(70, int_square(70, int_sub(70, 2*1, 2*2*(-1))), int_cube(71, 2*2*(-1))));
char_output(72, second_person);
exit_scene(74, romeo);
act_ii_scene_ii: /* Juliet and Ophelia ' s conversation */
enter_scene(78, ophelia);
activate_character(84, juliet);
assign(82, second_person, int_div(81, romeo->value, int_add(81, 2*2*1, (-1))));
char_output(82, second_person);
activate_character(89, ophelia);
assign(86, second_person, int_div(85, romeo->value, int_twice(85, int_sub(86, 1, 2*2*(-1)))));
char_output(87, second_person);
exit_scene_all(89);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment