Please follow me here!

Thursday, June 26, 2014

Fifty Facts about Gregory Desrosiers

Hello, everyone; Gregory Desrosiers here! Welcome to another blog post I want to bring up with you.

What I would like to do in this blog is present to you fifty facts about me; it was originally a YouTube set of videos started out by AGEntertainment, where it was soon followed up by Let's Player and Commentator user Chuggaaconroy (Emile Rosales-Birou). I'm going to present to you fifty facts about me, and I'm pretty sure there will be more to come in the future.

Well then, here goes nothing!

  1. I love both Princess Peach and Daisy, especially when Princess Daisy is wearing some notable clothing you've probably seen in Mario Golf: Toadstool Tour and Mario Super Sluggers; I'd only wish I would have played the Olympic Games series produced by Nintendo and SEGA, but I did not because I was feeling so terribly down from the social stigma I was having around me.
  2. I watched Sunrose112's attempt in playing as Princess Peach for a Figure Skating event taken place in the replica of the Pacific Coliseum that was originally built for the Vancouver 2010 Olympics.
  3. I own a copy of several DOS games: Duke Nukem 3D, Quake and its two mission packs, Rayman Forever, Screamer, Screamer 2, Carmageddon: Max Pack, Tomb Raider, and even Star Wars: Dark Forces, in which I'd only wish there was more in-game cutscenes and a few taken place during missions, because then the plot and the quality of the game would have been much better.
  4. Back in 2004, I did play the original ATARI demo of Rollercoaster Tycoon 3, which I found it to be extremely awesome, and so me and my parents decided to buy the game originally from Scholastic. However, because I did not had a powerful PC, I ran into performance problems, especially with lag during night-time scenarios, until today where I run things on a brand new HP ENVY laptop with Windows 8.1, and eight CPUs.
  5. In 2009, I was way into SEGA Model 2 arcades, especially WaveRunner and Top Skater.
  6. In August 2013, I spent one Friday afternoon watching The Smurfs 2, where even though there were mostly negative to moderate reviews, I seem to have praised it mostly because it revolved around trying to create something that was fun, yet cute and very fitting to the characters. In addition, I did praised the voiceover of Smurfette after the artist I love from watching "Firework": Katy Perry. It was then on that I only wish I would have gotten a job and had some money to spend on because then I would have a more reliable life and being able to have a blast at arcade game centers, cinemas, and restaurants, along with my friends.
  7. Looking at the history of Montreal, especially Expo 67, sounds really interesting to me. Although computers and the multimedia biz weren't so really known back then, I only wish I can go back in time and experience something like this so that way the feeling of cultural balance, as well as fun, would be there. Of course, I would try to make a multimedia title out of this where I would ask Montreal to give us the original plans and building blueprints to recreate the experience in a digital fashion.
  8. I played Lego Island a lot on my family's computer back in the late 1990s when the computer game and animation industries took over society by storm.
  9. I like Johann Sebastian Bach's Little Fugue in G Minor because in certain YouTube videos, the evil feeling does arise just as perfect as it seems. "Therefore, as keeper of this island, I hereby exercise my Prerogative of Correctional Displacation."
  10. I can definitely memorize quotes for sure. "Oh, good. You're just in time. I believe I've isolated the algorithm for making friends." "Sheldon, there is no algorithm for making friends!"
  11. Some music of Game Freak's Pulseman are so awesome to hear, especially Voltage Algorithm and Stereo Protect. (Composed by Junichi Masuda.)
  12. I have a copy of Riven: The Sequel to Myst (as a download).
  13. I have an account on five different social networks: Facebook, Twitter, Google+, LinkedIn, and Pinterest. I also have an account on Instagram.
  14. I was not that much into Guitar Hero, even though my dad did buy The Beatles Rock Band in Christmas 2009.
  15. I was born five years before Google was created, September 27, 1993.
  16. I only wish I can play old arcades, especially Mortal Kombat and Mortal Kombat II, even though I'll have to learn from experience first on how to play it and how to master it.
  17. My favorite place for poutines, which is a customary Quebec dish consisting of French fries, cheese curds, and salty gravy, is La Banquise, located on Rachel St. on the island of Montreal, a few blocks away from its Mont Royal subway station.
  18. I was born in the south shore of Longueuil, but I was yet risen to become an English person.
  19. I love drinking Mott's Garden Cocktail because it allows me to get two servings of vegetables and some potassium, vitamins, and lycopene, for every cup of serving.
  20. I've been eating a lot of junk foods, yet I am skinny and weigh just a little over 200 pounds, at about 6'3".
  21. In the summertime, although it won't happen this summer, I want to go out play beach volleyball with my friends, do some outings with them, and eventually feel like I am socially integrated with the people around me.
  22. I only wish I can create a computer game where Princess Daisy is the main character in her shorts overalls and not her usual princess dress in the Mario Party series.
  23. I was well-interested in Nadeo's Trackmania years old, but eventually I decided to give up my interest. However, I do find some things about the series interesting, even to this day, primarily for its custom track design system and the various elements you can put in for whatever track you create.
  24. I used to have a white female dog named Odie, but she died sometime in 2006.
  25. I have been using Facebook since the summer of 2009 because it makes me more connected to people, and I also used it as a cure for social dependency.
  26. If there was my favorite music from Mario Kart 64, it would be Koopa Troopa Beach and Rainbow Road. In fact, back in 2008, whenever I would listen to Koopa Troopa Beach on YouTube, it would made me think I need to travel back in time from where the game was released because of its amazing success for having to sell more than 8 million copies. Also, I would use it if I were to live happily ever after, with so much success, pride, and smartness; I can simply just ease in whenever I go on the beach, and then have a blast with my friends or something. As for Rainbow Road, it's more of my own success and me becoming so accomplished in what I've done and having an audience at the same time.
  27. I defeated MegaMan Juno, in Capcom's MegaMan Legends, using a Shining Laser with Attack Level 4, Energy Level 3, and Range Level 3 (MAX). "Wow, that's really big! I wonder what it is?"
  28. Speaking of which, I find that the looks of MegaMan Volnutt, with his helmet on, seem to be better than the original MegaMan, although it does destroy the original feeling I would get if I were to play the original MegaMan. However, I think it's because the first MegaMan game I've ever played was actually MegaMan 64.
  29. I do like a few past videos of Top Gear with Richard Hammond, Jeremy Clarkson, and James May, especially with the £500 Police Car videos. I saw all three on at least one video where they weren't together. They were on their own: Hammond in a Brainac video of alkali metals, Clarkson in an F-15 where he has gotten sick from the G-forces and hence he had a vomit bag in handy, and May on a Lockheed U2 where he and a United States Air Force Major flown up to 70,000 to look at the edge of space and do some recording on what it's like up there.
  30. I have played numerous N64 games when I was a child; I actually have a Blog post for you people to read and see what I've played before.
  31. I have a lot of video game nostalgia.
  32. My father was a proud fan of The Beatles; he was only 10 years old when they started their debut back in 1963.
  33. I actually do like recreational vehicles and coach buses. I only wish I could ride one coach bus for a long trip. In fact, I would sit right close to the driver next to someone else that I would also take care of the public announcements for the passengers on board.
  34. I follow various channels on YouTube because there are things that I do like.
  35. I was diagnosed with ASD in 1996, and through the efforts of my parents and my family, my diagnosis moved more to the Asperger's side.
  36. I only wish I had more motivation in writing numerous blogs and be more progressive in what I do because then I'll be able to get an audience big enough for donations on my crowdfunding campaign.
  37. I definitely do like a few Arkanoid games. In 2012, I worked on a short book on a concept I would have developed at Champlain College Saint-Lambert, only to find out that I was disadvantaged completely on the fact that if I was to sell the game, the royalties would actually go to the college and not partially to me and the development team.
  38. I definitely love eating nachos, tacos, and fajitas. I also love having homemade pizzas, even though the difficult part is the crust made out of bread.
  39. Last summer, I watched one of the videos where Veronica Taylor was at Anime Boston 2009, where once she played the voice of Ash Ketchum, in which it was so incredibly done and so nostalgic like that I'll never forget me watching Pokémon back in 1999.
  40. I've watched several different animations and kids shows in my childhood days, especially in Grade 6: Pinky and the Brain, Animaniacs, Video & Arcade Top 10, Uh-Oh with Wink Yahoo (it's actually Scott Yaphe), Yu-Gi-Oh!, Beyblade, Metabots, Digimon, Scooby-Doo: Where Are You, Arthur, Hey Arnold!, Spongebob Squarepants, The New Adventures of Winnie the Pooh, The Powerpuff Girls, Sailor Moon, ReBoot, Rocket Power, Rupert, Rugrats, and Cyberchase.
  41. I have been living in Boucherville with my parents ever since I was born, yet somehow I wasn't really open-minded to communicating with the people around me in my neighborhood and such; I wasn't completely aware on what the real world is about.
  42. There were certain games that I would have had when I was a kid at the time we had the original Sony PlayStation. It was only up until now that there are so many games out there that were successes.
  43. At one point, I went through catalogues of Playmobil sets and LEGO sets where there were so many wishes I wanted, yet my parents didn't had the money to make up for it. There were a few exceptions to it, but that would mean that to get all the sets I wanted, we would have to spend so much on expenses to get them.
  44. When I was a kid, I watched some French translated videos of Gerry Anderson's Thunderbirds, including Security Hazard, Pit of Peril, and Terror in New York City.
  45. I was fascinated that Microsoft Corporation succeeded in developing a Flight Simulator series, including the first copy of its critically-acclaimed Flight Simulator 2002. Not that I actually want to fly a real plane and become a pilot, but I found it fascinating to do some digitized simulations at the comfort of my own home. I bet it costed tens of millions of dollars to build it, though, because having to grab all geographical data is extremely tedious that there would be so many people involved in doing so.
  46. The first time I've seen Microsoft Train Simulator was in a German train-based magazine my dad subscribed and had it mailed to me.
  47. The first ever YouTube videos I've watched were special in-game recordings of Namco's Rave Racer directly from an original Japanese PCB.
  48. Another music I absolutely love is the Daisy Cruiser theme from Mario Super Sluggers; in fact, I watched a Flipnote Studio animation two years back from where I wanted to do something with money.
  49. I only wish I can go to the United States for more than just having to go inside arcade parlors and spend money on both new and old games, including games from my past.
  50. I am not so sure what my favorite fruit is, but as much as I like bananas, I can't eat them because they give me problems with stomach gas. (It seems to me that I need to start eating more healthy meals, including salads and some yummy vegetables, especially romaine lettuce, tomatoes, cucumbers, and carrots.
Well, that does it for this blog. It has taken so much time for me to write down that I had trouble concentrating, and hence it took longer than it should have to write this down. I definitely need to learn on how to keep my motivation to writing blogs up, because I definitely need to get a lot of views.

Would you please be so kind as to help me see what I can do to promote my blogs and get a bigger audience? What about asking me what kind of blogs you want me to talk about? Please let me know!

Anyway, have a good night!

Please follow my blogger by going to the top of this page, and click on "Join this site," big blue button with the Google logo!

Oh, and please make a donation to this campaign:
I would also appreciate if you could please spread the word; that would be awesome!
The campaign can also be found here:

I would really appreciate if you could please make a donation, primarily for me to pay the costs for my crowdfunding promotion!
 Click here to follow me on Facebook:
 Please follow me on Twitter:
You can also follow me on Instagram! @gregpdesig

The Ampersand Pyramid (Java Program)

Good morning, y'all!

I hope everyone is having a fine morning! (This was written on the morning of June 26, 2014)

It has come to my attention that some newcomer programmers would be asked to print certain characters in a certain format or shape. For example, a pyramid, where you would need to use a piece of paper to see the logic behind creating a program that prints characters in the shape of a pyramid directly on the console. You may be asked to write programs to print out characters in other formats such as a four-sided diamond called a rhombus, a circle, or something where you want to get used to the logical processes you can implement in any program.

Here's what I got here. I took simply several minutes to write this 32-line Java console-based program to print an upward pyramid, depending on the max number of columns, with ampersands. The pyramids are oriented at center based on the number of characters to be printed for each line of the program. As such, you would need to use a piece of paper, or if you're smart enough, your thinking, to see how you would print your first one or two characters directly at center of the first row.

At the second row, you would add two more ampersands on either side of the first row to form the output's triangular shape. Third row, you would do the same thing, except that you'll have either five or six ampersands. The choice will always depend on whether the max number of columns is either odd or even.

Let's say you want the program to handle maximum 25 columns. This is what the pyramid looks like, with the console font set to Consolas, 10 pixels:

Here's what a 30-column pyramid looks like:

And this is the output of a pyramid with 7^2, or 49, columns:

What do you say I share with you the source code of this program, and then I'll let you know on how this works?

package consolebaseddisplayprograms;

public class TheAmpersandPyramid
public static void main(String[] args)
int squareSize = 49, rowLimit;

if (squareSize % 2 == 0)
rowLimit = squareSize / 2;
rowLimit = squareSize / 2 + 1;

for (int row = 0; row < rowLimit; row++)
for (int col = 0; col < squareSize; col++)
if (squareSize % 2 == 0)
if (col <= (squareSize / 2 + row) && col >= (squareSize / 2 - 1 - row))
System.out.print(" ");
if (col <= (squareSize / 2 + row) && col >= (squareSize / 2 - row))
System.out.print(" ");


The way on how this program works is, assuming you changed the value assigned to the variable squareSize, the first if-else clause determines how many maximum rows are to be there in this set pyramid. In all the rows covered by this ampersand pyramid, we need to make sure that by the time we reach the last row, all the columns are covered by the ampersand. This is also to control the addition of ampersands on either side of the identical columns for every row gone through.

If squareSize is even, this means that there are two ampersands displayed on the first row. Because we add two ampersands on either side, this means that the maximum number of rows we have in printing this pyramid is half the number of maximum columns.

If squareSize is odd, though, there is a catch when it is divided by two and thus assigned to rowLimit. Dividing an odd number by two causes the decimal to be truncated, which means that we ignore the decimal, regardless of how high or low it is, and thus we only consider the whole number. If we have a max column count of 11, that means we can only print five rows, and thus by adding two ampersands on either side of the corresponding row based on the first row with one ampersand, we only end up with nine ampersands on the last row. To circumvent this problem, we simply add the truncated value with one. Thus, with six rows and starting from one ampersand, we will have 11 ampersands at the last row.

We now come to the for loops. The outer loop is to advance the rows, while the inner loop is to print the characters accordingly. We print the ampersands inside the boundaries defined by the conditional terms.

If squareSize is even, we determine whether the column is either less than or equal to half the maximum number of max columns plus the corresponding row index, or more than or equal to half the maximum number of max columns minus the sum of 1 and the corresponding row index. If it is, we print an ampersand character. If not, we simply print a space.

If squareSize is odd, we check the same, except that for the left side, we only check whether the column is greater than or equal to half the number of maximum columns minus the current row index. Printing the characters is the same process as well.

Once each row is printed, we go to the next line to print the characters there also. We keep on going until we reach the last row. Then, the program terminates.

Well, that does it for this morning blog. Have a good morning, and I'll talk to you soon!

Please follow my blogger by going to the top of this page, and click on "Join this site," big blue button with the Google logo!

Oh, and please make a donation to this campaign:
I would also appreciate if you could please spread the word; that would be awesome!
The campaign can also be found here:

I would really appreciate if you could please make a donation, primarily for me to pay the costs for my crowdfunding promotion!
 Click here to follow me on Facebook:
 Please follow me on Twitter:
You can also follow me on Instagram! @gregpdesig

Wednesday, June 25, 2014

Why should we have more followers on social networks?

Why, whenever we have our own profiles on Facebook, Twitter, Google+, Instagram, and all of those other social networks we have all around the world? Let me share with you three reasons!

  1. Social audiences give you confidence in business success, in the fact that they encourage you to do things that will satisfy their demand, and therefore your business will grow if you meet the objectives put forward by them, and by yourself!
  2. Social audiences give you more pay, more freedom, more vacation, and of course, more crowd, applause, and excitement!
  3. Finally, social audiences allow you to inspire them, to guide them, to influence them positively, leaving you a chance to give them guidance on what you have done to succeed, even after your death!

That's all I have to say; those are the three basic reasons why you need a social networking audience; do whatever you can to grow, become known, and live up for them and yourself!

Please follow my blogger by going to the top of this page, and click on "Join this site," big blue button with the Google logo!

Oh, and please make a donation to this campaign:
I would also appreciate if you could please spread the word; that would be awesome!
The campaign can also be found here:

I would really appreciate if you could please make a donation, primarily for me to pay the costs for my crowdfunding promotion!
 Click here to follow me on Facebook:
 Please follow me on Twitter:
You can also follow me on Instagram! @gregpdesig

Reality of using "Promote your social networking sites" on Social Networks

Reality of using "Promote your social networking sites" on Social Networks Have you just started a page on Facebook you definitely want to promote? Are you getting stressed out about building an audience that will follow your stuff? What's in your mind?

What I want to tell you today is some of the realities I have learned about trying to share your social networking profiles on different pages that just contain one word: promotion. The reason being is that considering that I went through this kind of experience with a few Facebook pages that were designed for promotion, if there were to be small businesses set up or even some entrepreneurship services or personal accounts, I would rather have them understand strong realities of this before they move on and run into problems.

This definitely applies to audience seekers like me, especially through the multimedia biz.

This blog post also works for crowdfunding pages and communities directly on social networks, although there may be a few exceptions, which I'll give you one at the end of my blog. In addition, I am limited to Facebook and Google+ communities. There may be certain promotional accounts on Twitter, but that's more at a personal or business level, because unfortunately, as of at the time this was written, June 25th, 2014, there are no communities to join on Twitter, unless you follow one individual who brings discussions by tagging other users.

You decide to join various Facebook communities designed to have you promote your thing and expect to get some follow ups later (and please don't mind me listing all the promotion communities I got on my Facebook profile): Promote Your Account Twitter, Promote TWITTER , FACEBOOK , PAGES , BLOG here', Promote My CrowdFunding: Campaign Promotion and Exposure, Crowdfunding: Kickstarter, IndieGoGo, and Other Fundraising Projects, Promote your Facebook page and get more likes, Facebook pages promotion groupLIKERS CLUB ( Kîŋǧ Ŋît'$ Promote ur Id n page, promote your pages, Promote Pages Here, PROMOTE MY PAGE, Page Promoting & Friends Group, Promote Your Pages, Promote Your Facebook page, Promote your PAGE [ FREE ], Promote your FB pages, Facebook Page Promote Exchange Group, PROMOTE YOUR PAGE HERE, page promote exchanging group, Promote your Group/Page here, Promote here your pages, groups, blogs, and sites, Page Promotion, Promote your Business,website,videos,fan pages,ideas etc online, Crowdfunding, Crowdfunding promotion page, SHAMELESS SELF-PROMOTION (Listen,Review,Promote your Music or Project), ™Promote Twitter,Fans Pages Facebookmu Di Sini! ™, Jum Promote twitter Dan Blogger, Promote your blog, and Blogger Ping.

In addition, you have joined up some communities on Google+ where you promote your Facebook page or whatever asset you have on social networking.

This is not to offend the administrators of those communities nor the members of the group, because I am pretty sure the administrators created these groups in the first place to share thoughts with one another and come up with suggestions on how to suit target on those new ideas to much bigger audiences in an elaborate way.

The thing is, if you are using those communities as your only promotional platform, even if your project is small, you may most likely fail. Let me explain why as a full opinion, totally different than an argument or a estimation that could be turned up or down. You don't necessarily have to agree on my opinion for this; I'm simply saying I can assure you that you would be better off having a bigger promotional platform than this.

When I shared my Facebook page on those communities, not that many people commented on my statuses saying that they have liked my page and they want me to like them back. There can be several reasons why I think that occasionally, we would not see that many results as we would estimate or expect, assuming our expectations are very realistic.

Let's say I share my thing to all of those communities I've noted to get a follow up. Here's why I would not be getting that many results as I would:

  • Different users in those communities may live in different time zones around the world, and as such, within a short time frame, there may not have been enough time for people on the other side of the world to like our page, follow us on Twitter, our Google+ account, or our Blogger posts.
  • The users who come into those social networks I noted may not take the time to look at all the posts the members have made every single day to see which page they want to like; even in a community with 10,000 members, by posting it on that community page, in a full day, you would only see less than 10 members coming to your part and liking it. It's especially if the audience you currently have is small and is not reached out as much as it should.
  • The page may not be professionally organized, including the short and long descriptions, the Profile Picture, the Cover Picture, the posts, or the features.
  • The name of the page would not be appealing to the members; for example, people would be appealed to more products than other people alone, because in the consumerism world, only products and services would give us an indication on whether or not that individual is to be well-appealed and followed by more newcomers and other people.
  • Lack of communication between the person who posted the page and possibly the administrators of the groups, because I believe that by having the administrators share your work, your visibility would be greater than having to post your thing yourself.
  • Other members of those communities are too occupied of their own, with their own material, instead of seeking out to communicate with other members, and give out opinions and such.
  • The audience trend since the project creation may not be very big, because if the number of user likes or follows increases on a large scale, it may encourage some users to follow it because it would sound interesting to them. For example, although I didn't do some researching myself, because of Rovio's cautious attention in development and publishing, the number of downloads of the original Angry Birds skyrocketed because the overall trend was originally high enough that the audience started encouraging others to play the game, and hence newcomers were convinced.
  • You may have not yet opened yourself up on social networks other than Facebook. There are ups and downs in each one, but if you do sign yourself up and work hard on each one, you will gain your visibility. But don't expect this to become instant, because this will invest a lot of time, and possibly some money if you need to grow an audience quickly. For example, Twitter; I'm currently at 1,000 followers, even though most of them would not be seeing my newest tweets because the news feed is too overwhelmingly congested with tweets of other members, especially if you are following too many Twitter users, like mine close to 2,000.
  • Social networks go around the world, yet there may be some cultural barriers to overcome, probably with some translation and localization needed.
  • The worst thing I've seen is, once people start liking your thing where you shared it from the promotion page, they usually would not follow up on your post and make suggestions, especially if your audience is so small! This even happens if you don't spend a lot of money on exclusive advertising on Facebook; you'll need a budget to do this!

You don't necessarily have to agree on all of the points; remember, this is my opinion. There's never a no or right answer on this; I'm pretty flexible to learning new things, because remember, I'm unexperienced. People who are not so experienced in this may not deserved to be followed, but they are to be convinced and taught some lessons about more of the reality.

Anyway, the general reality is, you can still join these communities and post your thing, even if your promotion visibility is very big, but you won't be getting that much followers and success from them alone. That's why you need to work on building your audience from the ground up, especially if you are short on money to spend on for advertising. Or, if you do have money to spend on ads, you can do so, but make sure you plan carefully and get some words of advice from campaigners who were successful.

What I'm doing for my audience in my campaign, although there were a few things I wasn't aware of at first when I did put up my crowdfunding campaign in the first place, is writing a whole series of blogs, such as this, where I share them on my social networks and I let people come in and read it. Thus, I can get followers on Twitter.

I even got word from the CEO of the promotional firm CrowdClan, Aaron Djekic, that one way on crowdfunding promotion is social network audiences. I came across a site where it says you need to build your audience way in advance, like several months, before you begin your campaign, if you want it to be successful. As for me, I was not aware of it way ahead in advance, and hence I am risking to spend some money on advertising my campaign. So what do you say you please help me out while I write numerous blogs by making a donation for crowdfunding advertising costs?

I'm Gregory Desrosiers. I live outside of Montreal, struggling to help my family pay the total costs of University of Waterloo for this fall. I am doing Honours Software Engineering, Co-Op, in one of Canada's most prestigious universities! I would be happy if you could please help me out here, because I do not only want to stop experiencing major discrimination I'm having over here in Quebec on the basis of language, even though I was born there. I also want to take advantage of earning a wonderful life and experience by working with some management in large corporations, building my experience in video game development, and also taking the time to go out and have some fun in the fun Ontario environments I will be offered when I move there!

Just one note I want to make before I close this blog: For crowdfunding campaigns that you desperately need an audience with, and whether you have a set budget you can use or not, I'd recommend checking this group called "Crowdfunding Marketing. KickStarter & IndieGoGo projects promotional tips." Now, you cannot promote your campaign there, nor can you share it for another purpose besides asking for some advice on how to better promote your campaign. I'm still new to it, so it's up to you to check it out and experience it!

You can also ask several users on Facebook, Twitter, Google+, and all of those other social networks you're on to see what you can do to build your audience and get your thing across perfectly.

That does it. Well, talk to you later!

Please follow my blogger by going to the top of this page, and click on "Join this site," big blue button with the Google logo!

Oh, and please make a donation to this campaign:
I would also appreciate if you could please spread the word; that would be awesome!
The campaign can also be found here:

I would really appreciate if you could please make a donation, primarily for me to pay the costs for my crowdfunding promotion!
 Click here to follow me on Facebook:
 Please follow me on Twitter:
You can also follow me on Instagram! @gregpdesig

Tuesday, June 24, 2014

Rock Paper Scissors Lizard Spock (JAVA Program)

Rock Paper Scissors Lizard Spock (JAVA Program) It's time for another JAVA program to exhibit for new programmers; this time, with Rock Paper Scissors Lizard Spock!

It's another fine day here in the countryside outside of Montreal. We got gorgeous sun right above us, even though yesterday was technically the summer solstice, in which now I'm feeling kind of down because I wasn't able to get together with my friends and have a wonderful time hanging out; it's a way for me to earn a better self-esteem and social living, because eventually I'll be with multiple classmates at University of Waterloo.

In case you're wondering about me with the FIFA World Cup 2014, technically I'm not watching it because I am more interested in paying attention to video games and working on building massive audiences for crowdfunding and public attention. In addition, I don't have enough money to build a concert at my town, participate in a drama or vocals show, join up with a television team, or even learn the secrets behind mass media and how to earn attention and promotion.

Anyway, what I want to show you today is a program I've worked on last night that I have just completed; it's a way for me to get my intelligence in JAVA back because I'll need to use programming and different kinds of talent from my time at college to be used in my first-year classes at University of Waterloo. It won't be easy, but with the kind of advice and treatment, I can earn a wonderful time and be so integrated with the people around me.

This is my own text-based program of Rock-Paper-Scissors-Lizard-Spock, which is a change in Rock Paper Scissors, and it was created, according to Wikipedia, Sam Kass and Karen Bryla. It was used in one episode of the Big Bang Theory; Raj and Sheldon did this kind of draw to decide which show they should watch together. Sheldon is up for Saturn 3, while Raj is up for Deep Space Nine. After Sheldon gives out the details of the draw with some non-verbal communication to show which sign is which in the game, he and Raj give out a shot in which they both end up using Spock.

Here's what Sheldon said, which is pretty much the details of the draw (originally written by teleplay writers David Goetsch and Jennifer Glickman): "Scissors cuts paper. Paper covers rock. Rock crushes lizard. Lizard poisons Spock. Spock smashes scissors. Scissors decapitates Lizard. Lizard eats paper. Paper disproves Spock. Spock vaporizes rock, and as it always has, rock crushes scissors." 

The program I wrote is a console-based application; all the graphics used in this implementation are Unicode characters predetermined within the Java Virtual Machine. What I'll do is show you a quick visual example of how the program works, and then I'll give you the code for it. Take note that I'm running this program on an IDE called Eclipse Kepler; more specifically, Eclipse JAVA EE IDE for Web Developers.

In starting the program, we get a two-second pause before we get a message saying the computer makes its move first. And then after another two-second pause, we get a message to enter a character corresponding to one of the five different moves of this game. Type in either, 0, 1, 2, 3, or 4, and press the Enter button.

Typed in 0. Oh, too bad; the CPU wins. Paper covers rock. Time to play again!

Computer goes first again; time to type in our move!

Type in 6: error. Type in 55: error again! Pay attention to the messages!

I type in 4, as in Spock, and it looks like I win! Spock vaporizes rock!

After asked to play again, in which I do, I type in nothing at the start. Ah, error detected! And so now, I type in 3, where I make my stance for Lizard.

Oh, dear! It looks like we have no winner! One last try in playing!

I make my move for paper, and I win. Paper disproves Spock. And it looks like I don't want to play again, so it's quit, and good-bye!

With the photographs now out of the way, let me share with you now the source code of this program and how it actually works. Modifications are done so that way you can see what it is I'm talking about.

To make understanding much easier, let me give you a description of what you are expected to see in the source code of this program. I've colored-coded the elements of the code so that way as soon as you see them the first time, you'll know what is that feature and what color is used to distinct it.

The text highlighted in black is the details on how the full program works. The text highlighted in dark green are technical details.

This is the source code of this text-based Rock Paper Scissors Lizard Spock program. There are other ways to implement this, but this is how I've implemented it myself. These are the instructions you feed into the Java Virtual Machine to execute and perform. Feeding instructions in any computer involves a programming language.

Programming has so many worldwide applications that it is now part of most of natural and service jobs all around the world. The biggest use of programming is, of course, in the computer gaming and telecommunications industries.

Anyway, let's continue on with going through the source code.

// Written on June 21 - 22, 2014
Anything you see in a greenish color with two forward slashes is a single-line comment. You can write anything in a single-line comment as long as two forward slashes precede it. Usually, when you type in something in a source code file, the compiler is supposed to compile everything that's in the file. However, the compiler ignores comments, just as long as there is a combination of symbols to denote which is which.

import java.util.Random;
import java.util.Scanner;

Any word highlighted in blue is a keyword. Text highlighted in olive is a package name, since certain instructions can be stored as data recipes, or classes, on their own. And a name in tan is a class name.

Here, we're loading access to two different classes, Random and Scanner. Because the default package used in JAVA programming is java.lang., we must import other packages if we want to consider using a specific class belonging to those individual packages. Simply put, it's to let the compiler know, "Okay, this code requires the use of those classes," and thus the libraries holding those classes are loaded into the compiler accordingly.

java.util.Random is a programming entity containing methods that return a value by using randomization algorithms. java.util.Scanner is a basic data entry for file input, or keyboard input through the console.

public class RockPaperScissorsLizardSpock

"RockPaperScissorsLizardSpock," colored in pink, is the name of the main class for which the compiler is to convert text into a binary format compatible with the Java Virtual Machine.

"public" is an access specifier, on the fact that in object-oriented programming, instructions are to interact with the main code of other classes, as well as the objects that these classes may store on purpose.

"class" is pretty straightforward; it's simply telling the compiler that there is a data recipe to be compiled.

In JAVA, any program that has an execution method is defined as a class; simply, a blueprint of what is to be instantiated during execution.

// Constants
public static final String[] CONSTANT_MESSAGES =

A name italicized and purple is a static variable. Because we have a constant where the value assigned to that variable is not changed at all, the name is also in capitals.

The keyword "final" is to tell the compiler that the value assigned to the variable is a constant and cannot be changed any way during execution.

Instead of using multiple String variables, or constants, for use in the program, to offer some flexibility and easier handling, most of the messages used in the program are stored in this pre-assigned String array.

This array holds most of the messages you see during gameplay. It's designed to have a bank of messages, all carefully indexed and categorized, so that way there can be more than one message of the same thing accordingly. This opens flexibility for the computer to decide randomly which message to use for the particular phase of the game.

    *  Who goes first?

Anything in orange is a comment block. Like single-line comments, the compiler ignores it as long as you have the proper syntax for it. Start with /*, and end with */. The advantage of a multi-line comment block is that you won't have to type in // for every single line. All you have to do is make sure that the comments are typed preceding the tag */.

Anything you see in red is a string literal. A string is a computer entity consisting of a character or more, including special Unicode characters.

// Player goes first (0 - 6)
"You make your move first.",
"You go first.",
"I'll let you go first.",
"Go for your move!",
"Why don't you go first?",
"Please, make your first move.",
"Alright, let's see what your move is.",
// CPU goes first (7 - 15)
"Why don't I go first?",
"I'm going first.",
"I go first.",
"I shall go first.",
"It will be my prior to make a move first.",
"You let me go first.",
"Mr. Computer shall go first.",
"Your CPU decides what move to pick primarily.",
"Let's see what my move will be...",
   *  Winner Messages (16 - 20)
"Awesome; you win! ",
"CPU surrenders! ",
"White flag for the CPU; ",
"Winner! ",
"WIN. ",
    *  Loser Messages (21 - 25)
"Too bad, you lose! ",
"You lost. ",
"You lose! ",
"You are forced to surrender. ",
"LOSE. ",
    *  No Winner Messages (26 - 31)
"No winner in this case!",
"We have a draw!",
"It looks like no one wins!",
"No winner!",
"A winner is ceased to exist!",
"Uh-oh, no winner.",
    * Command Messages (32 - 41)
"Scissors cuts paper.",
"Paper covers rock.",
"Rock crushes lizard.",
"Lizard poisons Spock.",
"Spock smashes scissors.",
"Scissors decapitates lizard.",
"Lizard eats paper.",
"Paper disproves Spock.",
"Spock vaporizes rock.",
"Rock crushes scissors."
Anything that is colored in light blue is a number literal.

public static final byte CHOICE_IS_ROCK = 0,

"byte" is a primitive data type, in the sense that it is directly stored in the RAM as a sequence of bytes without using a reference address. In JAVA, most of the primitive data types are signed, and thus a variable of type byte can hold a value between -128 and 127.

In this program, the values 0 to 4 are used to represent the five different movements a player can make in Rock Paper Scissors Lizard Spock.
public static final Random aiObject = new Random();
public static final Scanner keyboardInput = new Scanner(;
Although the objects aiObject and keyboardInput are static constants where their variable names should be capitalized and the underscore is used, they are left in conventional format for variables that are not constants because

public static void main(String[] args)

Any text preceding the left curved bracket, or left parenthesis, and colored in a maroon-like brown is the name of a method. Except for static variables, text colored in light green is an object reference pointer, or reference variable.

This is the header of the prime method the JVM executes upon running: the "main" method, with an array of command-line arguments passed as the method argument. When you run your program through the computer terminal, such as Command Prompt on Microsoft Windows, any additional text you add, separated by spaces, after the name of the class file to execute, are the arguments that this method takes in.

You don't necessarily have to type in a command. In this case, there is no command to type in for the functionality of the program, so what happens is, this array is created, but of fixed size 0.

"void" is a return type for a method, where the method is not forced to return a value or a reference address. Primitive data types, arrays, and names of classes from respective packages are compatible as return types of methods.

     *  Declaration and Construction Phase
String messageString;
byte playersChoice, computersChoice;
boolean playAgain = false;

There are only two values used in a boolean variable: true, and false.

Text colored in gray is a primitive data type variable. Text in black is therefore syntax.
// Starting Message
System.out.println("Hello there!");

"Hello there!" is the first message you see in the output of this program.


As soon as the first message is displayed, this program is paused for about two seconds by calling this method. 

        *  Input Phase

The first thing the program does is, it makes a draw to who should go first and make their move. Technically, both players choose a move instantly, but because the computer needs to register the player's input, which does take some time, the input is sequential instead of instant. As such, we want to deal with two different kinds of input and processing, but the rules of the game are definitely followed anyway because the outcome is not displayed until the very end.

if (aiObject.nextBoolean()) // AI goes first
System.out.println(CONSTANT_MESSAGES[aiObject.nextInt(9) + 7] + "\n\n");
There is a 7 to add to the value returned from the "nextInt" method because it is to make sure that if the computer decides to go first, then no matter what message is displayed from this array, it's always a message saying that the computer makes its move first.

computersChoice = computerMakesMove();
playersChoice = playerMakesMove();
System.out.println(CONSTANT_MESSAGES[aiObject.nextInt(7)] + "\n\n");
playersChoice = playerMakesMove();
System.out.println("Please wait as the computer decides.\n");
computersChoice = computerMakesMove();

Technically, the value is returned from the method computerMakesMove and assigned to computersChoice right away; the call for the pauseProgram method is simply there to let the user think that the CPU is deciding its move.

         *  Process Phase
Whatever the way on who is first, once the decisions are set, the program goes through a case-by-case decision structure to determine the proper message to be displayed on output based on the player's movements. "nextInt" is a method that returns a random value from 0 to 5 exclusively, and thus it is used in sum with a constant to get a winning, losing, or tie message. If the player is winning or losing, an associated message comes with it to display as well, giving out one of the rules of the game.

There are two sets of decision structures, along with an "else" at the very end to deduce that no one has won the game.

The first set of if-else-if clauses are for the player's chance of winning.

The program uses the equals operator and the logical AND operator to determine what were the moves chosen in the game by comparing the chosen values with the constants corresponding to the rules of the game.

// Player's Streak
if (playersChoice == CHOICE_IS_SCISSORS && computersChoice == CHOICE_IS_PAPER)  
               // Scissors cuts paper
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 16] + CONSTANT_MESSAGES[32];
else if (playersChoice == CHOICE_IS_PAPER && computersChoice == CHOICE_IS_ROCK)  
               // Paper covers rock
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 16] + CONSTANT_MESSAGES[33];
else if (playersChoice == CHOICE_IS_ROCK && computersChoice == CHOICE_IS_LIZARD)  
               // Rock crushes lizard
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 16] + CONSTANT_MESSAGES[34];
else if (playersChoice == CHOICE_IS_LIZARD && computersChoice == CHOICE_IS_SPOCK
               // Lizard poisons Spock
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 16] + CONSTANT_MESSAGES[35];
else if (playersChoice == CHOICE_IS_SPOCK && computersChoice == CHOICE_IS_SCISSORS
               // Spock smashes scissors
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 16] + CONSTANT_MESSAGES[36];
else if (playersChoice == CHOICE_IS_SCISSORS && computersChoice == CHOICE_IS_LIZARD)
               // Scissors decapitates lizard
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 16] + CONSTANT_MESSAGES[37];
else if (playersChoice == CHOICE_IS_LIZARD && computersChoice == CHOICE_IS_PAPER
               // Lizard eats paper
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 16] + CONSTANT_MESSAGES[38];
else if (playersChoice == CHOICE_IS_PAPER && computersChoice == CHOICE_IS_SPOCK)  
               // Paper disproves Spock
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 16] + CONSTANT_MESSAGES[39];
else if (playersChoice == CHOICE_IS_SPOCK && computersChoice == CHOICE_IS_ROCK)  
               // Spock vaporizes rock
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 16] + CONSTANT_MESSAGES[40];
else if (playersChoice == CHOICE_IS_ROCK && computersChoice == CHOICE_IS_SCISSORS)
               // Rock crushes scissors
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 16] + CONSTANT_MESSAGES[41];

The next set of if-else-if clauses are for the computer's chance of winning.

// CPU Streak
else if (playersChoice == CHOICE_IS_PAPER && computersChoice == CHOICE_IS_SCISSORS
               // Scissors cuts paper
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 21] + CONSTANT_MESSAGES[32];
else if (playersChoice == CHOICE_IS_ROCK && computersChoice == CHOICE_IS_PAPER)  
               // Paper covers rock
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 21] + CONSTANT_MESSAGES[33];
else if (playersChoice == CHOICE_IS_LIZARD && computersChoice == CHOICE_IS_ROCK)  
               // Rock crushes lizard
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 21] + CONSTANT_MESSAGES[34];
else if (playersChoice == CHOICE_IS_SPOCK && computersChoice == CHOICE_IS_LIZARD) 
               // Lizard poisons Spock
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 21] + CONSTANT_MESSAGES[35];
else if (playersChoice == CHOICE_IS_SCISSORS && computersChoice == CHOICE_IS_SPOCK
               // Spock smashes scissors
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 21] + CONSTANT_MESSAGES[36];
else if (playersChoice == CHOICE_IS_LIZARD && computersChoice == CHOICE_IS_SCISSORS)
               // Scissors decapitates lizard
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 21] + CONSTANT_MESSAGES[37];
else if (playersChoice == CHOICE_IS_PAPER && computersChoice == CHOICE_IS_LIZARD
               // Lizard eats paper
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 21] + CONSTANT_MESSAGES[38];
else if (playersChoice == CHOICE_IS_SPOCK && computersChoice == CHOICE_IS_PAPER)  
               // Paper disproves Spock
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 21] + CONSTANT_MESSAGES[39];
else if (playersChoice == CHOICE_IS_ROCK && computersChoice == CHOICE_IS_SPOCK)  
               // Spock vaporizes rock
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 21] + CONSTANT_MESSAGES[40];
else if (playersChoice == CHOICE_IS_SCISSORS && computersChoice == CHOICE_IS_ROCK)
               // Rock crushes scissors
messageString = CONSTANT_MESSAGES[aiObject.nextInt(5) + 21] + CONSTANT_MESSAGES[41];
// No winner

If there are no winners at all, the last if-else-if clause is executed.

messageString = CONSTANT_MESSAGES[aiObject.nextInt(6) + 26];
         *  Output Phase


When the proper message is assigned to the corresponding reference variable "messageString," it is displayed to tell the user who has won the game, or that the game was a draw.
playAgain = playGameAgain();

After another two-second pause, the user is asked whether to play the game again. If he does, we run the same algorithm starting after the left brace of this post-test loop, known as a do-while loop, where the inside of that loop is executed at least once. If not, the loop ceases to have another iteration executed and thus we move on to closing the program.
} while(playAgain);
// Closing Phase
System.out.println("\nThank you for playing!");

Before the program is terminated, we close the input.

public static void pauseProgram()

A computerized task is simply a list of instructions that is assigned to a CPU to execute. A thread holds this task awaiting for a timely execution along the CPU. You can run any number of threads in a program you write to do, let's say, some sorting by chunks, known as multithreading, because you create multiple tasks that the CPU can execute at the same time.

You have several thread management options at your disposal. In this case, we're making the thread running this program to pause for 2 seconds, or 2000 milliseconds. This method is called in a block that is actually there to watch out for any potential errors that can occur when it is called. Such errors in programming that are thrown by data entries are called exceptions.

This block makes an attempt to call the method, and "catch" any potential error this method can throw.

catch (InterruptedException ex)

"InterruptedException" is a JAVA-based error class that an object is created and thus "thrown" into the executing code when the only thread running in this program is called to sleep, but is currently sleeping, or has its task completed.


Passing on the value "1" as an argument of the static method exit denotes that the program is to be terminated based on abnormal status.

Anytime the program encounters an error while executing the method to sleep for two seconds, what happens is, as soon as this method catches it, a method is called to display details on what is the error, where did it come from, and what line is it fired from the corresponding source code. In addition, the JVM executes a method for which the program it's currently running is forced to be terminated.

public static byte playerMakesMove()

This is where you type in your move.

String inputString;
boolean entryIsValid = true;
System.out.print("\n\n\nEnter a number corresponding to your move:\n\n"
+ "0: Rock\n"
+ "1: Paper\n"
+ "2: Scissors\n"
+ "3: Lizard\n"
+ "4: Spock\n\n"
+ "Your entry: ");
inputString = keyboardInput.nextLine();

The "nextLine" method takes input directly from the console, whether it is the computer terminal, such as Command Prompt on Microsoft Windows, or the white text area of integrated development environments that are named "Console." On Eclipse IDE, it has a tab to denote which element is which opened aside from the source code alone.

This is where you type in an index corresponding to one of the five different movements in the game.
if (!inputString.equals(""))
if (inputString.length() > 1)
System.out.println("\nInput error: Too long. Please enter only one character.");

Because the input used in this program is not really limited in terms of how long it can be, if it's more than one character, you'll have to type it in again, because the entire input is considered for this method to return an index corresponding to your move later on.

entryIsValid = true;
if (inputString.charAt(0) < 48 || inputString.charAt(0) > 52)
entryIsValid = false;
System.out.println("\nInput error: Does not correspond to the choices given. Please "
                            + "enter a value corresponding to one of them.");

If your input is not one of the five indexes, being a number from 0 to 4 inclusively, you get this message and thus you have to type in your input again.

System.out.println("\nInput error: No input. Please enter again.");

You can't make a move without typing in a character; as such, this message appears.
} while(inputString.equals("") || inputString.length() > 1 || !entryIsValid);
System.out.println("\nInput accepted.\n\n");
A case-by-case decision structure causes this method to return a value representing a move accordingly.

if (inputString.equals("0"))
else if (inputString.equals("1"))
else if (inputString.equals("2"))
else if (inputString.equals("3"))
public static byte computerMakesMove()
return (byte)(aiObject.nextInt(5));

There is a cast to downside the amount of space a value takes up in the RAM, because there are only five different moves. There is no method in the Random class that returns a signed byte (a number with eight binary digits that holds values in the range of -128 - 127). As such, we call nextInt, given a specified range where 4 is the maximum, where the method returns a signed four-byte integer (within the range of -[2^31] to 2^31-1), and then take the first eight binary digits to be assigned as a byte.

All this method does is, it returns a random index that represents one of the five movements the player or the CPU can make.

public static boolean playGameAgain()

This is where the program asks you to whether or not you want to play the game again.

String inputString;
boolean inputIsGood = true;
System.out.print("\n\n\nWould you like to play the game again?\n\n"
+ "Please enter a character corresponding to one of the choices:\n"
+ "0: Yes\n"
+ "1: No\n\nYour entry: ");
inputString = keyboardInput.nextLine();
Just like the input for making your move, you'll have to type your input again if there is more than one character, there is nothing in the input, or if the character is invalid.

if (inputString.equals(""))
System.out.println("\nInput error: No input. Please enter again.");
inputIsGood = true;
if (inputString.length() > 1)
System.out.println("\nInput error: Too long. Please enter only one character.");
else if (inputString.charAt(0) != '0' && inputString.charAt(0) != '1')
System.out.println("\nInput error: Does not correspond to the choices given. Please enter a "
                       + "value corresponding to one of them.");
inputIsGood = false;
} while(inputString.equals("") || inputString.length() > 1 || !inputIsGood);
if (inputString.charAt(0) == '0')
return true;

Using the input for "yes" will cause the main loop of this program to repeat again, allowing you to play the game once more.

return false;

If you decide not to play the game once again, the main loop does not repeat; instead, the last message of the program is displayed, the input is closed, and thus the program is terminated.


I think that will do for this blog. This one took me a lot of time to put together; it took me over eight hours in a two-day period to work on this! But I'm pretty sure this is some first experience in learning what a Rock Paper Scissors Lizard Spock JAVA implementation would be like, although it does differ from program to program!

Anyway, have a wonderful night, and I'll talk to you later!

Please read up my blog on my volunteering!

Please follow my blogger by going to the top of this page, and click on "Join this site," big blue button with the Google logo!

 Click here to follow me on Facebook:
 Please follow me on Twitter:
You can also follow me on Instagram! @gregpdesig

Google+ Followers

Popular Posts by Gregory