Posts tagged star wars

Jedi Name

lightsaber

A simple Java class that calculates your Jedi name based on your first, last name, mother’s maiden name and the city you grew up.

/*
 Jedi first name: 1st 3 letters of last name + 1st 2 letters of first name
 Jedi last name: 1st 2 letters of mother's maiden name + 1st 3 letters of city you were raised in
 */
 
public class JediName {
   private static String capitalize(String s){
      return s.substring(0,1).toUpperCase() + s.substring(1,s.length()).toLowerCase();
   }
 
   private static String sub(String s, int begin, int end){
      return s.substring(begin, (s.length()>=end)?end:s.length());
   }
 
   public static String generate(String firstName, String lastName, String city, String mother ){
      String jediFirstName = capitalize(sub(lastName, 0, 3) + sub(firstName, 0,2));
      String jediLastName = capitalize(sub(mother,0,2)+ sub(city,0,3));
      return jediFirstName + " " + jediLastName;
   }
}

I used inline conditional expression ()?: to avoid raise a IndexOutOfBoundsException when the string is to small to cut the proper size we want.

And a example of how to use it:

public class JediNameTester {
	public static void main(String args[]){
		String myJediName = JediName.generate("Pedro", "Madeira", "Fortaleza", "Maria");
		System.out.println(myJediName);
	}
}

My jedi name is Siljo Iruba. :)

My Free CharSet version 5

Fifth version of my My Free Charset, now staring a char version of a Imperial Storm Trooper from the George Lucas’ Star Wars universe.

Sources (for GIMP): chars.xcf

Bellow  it with the complete suit.

pixelart imperial stormtrooper

And how without helmet.

pixelart imperial stormtrooper no helmet

Ps: Notice that due to a mistake in my counting, I had to jump the version number 4.

May the source be with you

Um desenho que eu fiz a pedido do Hildeberto para fazer uma camisa do CEJUG para ele usar no Javapolis, que tem como tema desse ano o Star Wars.

Cejug, Yoda, May the source be with you, star wars, café

Outras versões:

Ganhei dois jogos

Ganhei dois jogos antigos originais com caixa e tudo.

Caixas dos jogos Jedi Knight e Warcraft 2
Joguinhos novos

O da esquerda é o Jedi Knight, Dark Forces 2. Eu adoro jogos dentro do ambiente do Star Wars. Eu cheguei a jogar o demo desse jogo a muito, muito tempo atrás. O da direita é o Warcraft 2, um jogo que eu sempre quis ter o original porque eu adoro essa capa dele. E o melhor de tudo é que é uma versão brasileira, dublada em português que eu procurava a algum tempo. Eu não consigo nem calcular quantas horas eu já passei jogando Warcraft 2. Agora eu vou poder finalizar o jogo vendo todos os vídeos e jogando em português.

O próximo passo é fazer eles rodarem no Linux. Acho que com o Cedega isso não vai ser problema.

Valeu Italo! eba eba