Poetic Inner Join

HGWells JaneAusten

If you were to take an author’s works as the starting point for what they could potentially create if they continued to be influenced by their peers and their environment, it might sound something like the output of this program, where the words chosen reflect the author’s inner voice as well as external influences.

Continue reading

Character Swap Post Mortem

I had been planning to create character swap well before I declared my intent to participate in this years’ NaNoGenMo, but joining this project solidified the idea for me. NaNoGenMo is based off an idea my friend Darius had in 2013 in response to the National Novel Writing Month, which encourages writers to write a 50,000 word novel in the month of November. The NaNoGenMo project encourages programmers to write code that generates a novel of 50k+ words with the only rule that you share the novel and your source code at the end.

I chose The Adventures of Sherlock Holmes by Arthur Conan Doyle as the first book to undergo a character swap mainly because it is a popular book of short stories with distinct and memorable references to gender which also exists in the public domain and so is freely available to modify.

adventures_sherlock_holmes

Continue reading

The Count Recursively Laugh Counting

The Count from Sesame Street came up in a code review and it was mentioned that if he ever tried to count his laughs it would be recursive and infinite due to his immortality. I wrote a small recursive program to demonstrate the Count’s folly, which running with finite memory counts 9629 AH’s before stack overflow.

import java.util.ArrayList;
import java.util.List;

/**
 * The recursive laugh counting of Count Von Count.
 */
public class CountVonCount {

private List notCounted = new ArrayList<String>();

public static void main (String[] args) {
  CountVonCount theCount = new CountVonCount();
  theCount.laugh();
}

private void laugh(){
  String ah = new String();
  notCounted.add(ah);
  count(ah);
}

private void count(String ah){
  if (notCounted.contains(ah)){
    String ahAh = new String();
    notCounted.add(ahAh);
    System.out.println("That's " + notCounted.size() + " AH's!");
    count(ahAh);
  }
}
}