John Mercier

java programming and scjp

  • Blog
  • Projects

24 Game

Posted on October 11, 2010 by John J Mercier

Filed under Projects | 0 Comments

Does anyone remember the 24 card game? It's played with a deck of cards minus the face cards and 10. So there are four suits of 1(ace) to 9. Then the cards are divided between two players and each player lays two cards on the table. The first player to use those cards, along with addition, subtraction, multiplication, and division, to get to 24 wins the pile. The game is fun and easy but how can you calculate if four numbers are solvable? How many combinations of the 40 cards have solutions?

Yesterday I wrote a program that there are 6561 possible combinations and 2133 card combinations with solutions of 24. First the program loops through each combination of cards. Then it checks each combination to see of there is a solution of 24. I also wrote a method that will print the solution with parenthesis to keep the precedence of each operator correct. There are also options to customize the game. You can change the low and high cards, check for solutions other than 24 and even check for a range of solutions. Instead of putting this project in a jar file I'm just going to post the code here and the output here.

[Read More]

Share |

Album Creator 1.0a

Posted on December 19, 2009 by John J Mercier

Filed under Projects | 0 Comments

Image ConverterAlbum Creator 1.0a
Released: February 21, 2009
Created: April 2, 2007

Album Creator 1.0a is a program I wrote to generate the photo album for VAQ-138. It was really only used once, but I learned alot about swing, multi-threading, velocity, Netbeans, and Java2D. Please, read the webpage to learn more about why and how this program was made.

Share |

moaxcp

Posted on December 18, 2008 by John J Mercier

Filed under Projects | 1 Comments

moaxcp is an old web site I created at johnmercier.net. I started working on this project in 2003 while I attending PTI. The web site is actually built on top of another project I made for blogging called blogson. Blogson has many blogging features but is not very good for everything a website might need. moaxcp was a presentation of every project I had made at that time.

Technology used: jsp, jdbc
Design Pattern: Model 1

The view is not seperated from the model or control at all. In fact, all three of them are combined. Each module of the program is in its own jsp file so the index.jsp only has to include the header, footer, left, center, and right jsp files. The index.jsp file also includes a connection.jsp file which connects to the database and creates a Statement object for all the modules to use. Each jsp file can include other jsp pages. This allows for a seperation of code but does not seperate the scope used for each jsp. This is slightly different from the traditional Model 1 approach but once the jsp is precompiled it all gets turned into one jsp page for the program.
Interesting featers:
  • The ant build script creates a build.properties file containing an auto-incrementing build number and date. This file is read by the jsp page to display the information.
  • The ant build script actually deployed the entire site, through ftp, to the host server.
  • The ant build script zipped all projects into a zip file for the Download section of the site.
  • The ant build script created md5 checksums for each download in the Download section.
Again this project was only meant to combine all of my projects in a webpage.

Share |

  • General (12)
  • Projects (3)
  • Programming (14)

Search

Tag Cloud

activism addthis.com data_structure downloading facebook google google-buzz introduction java javablackbelt jdbc johnmercier.com jsp linux model-1 netbeans nvidia objectivism official-english programming projects pti roller scjp server sql theme uncertainty velocity welfare-state

Friends

  • Ed
  • Shane

Links

  • Glazed Lists
  • JGoodies
  • Java Specialists
  • Swing 2.0
  • Swing Generics
  • ideone
  • pircbot

Feeds

  • All
  • /General
  • /Projects
  • /Programming
  • Comments

Referrers

  • direct (125)
  • keflex.tr.gg/KEFLEX- (10)
  • pheromones-to-attrac (8)
  • www.beeplog.com/2609 (6)
  • softbanhtc.info/site (5)
  • softaxianhtc.info/si (5)
  • softbanhtc.info/site (5)
  • softbanhtc.info/site (5)
  • softbanhtc.info/site (5)
  • softcelandroid.info/ (5)
  • softaxianhtc.info/si (5)
  • softbanhtc.info/site (5)
  • softcelandroid.info/ (5)
  • softcelandroid.info/ (5)
  • softcelandroid.info/ (5)
  • softaxianhtc.info/si (5)
  • softcelandroid.info/ (5)
  • softcelandroid.info/ (5)
  • softcelandroid.info/ (5)
  • softaxianhtc.info/si (5)
  • softcelandroid.info/ (5)
  • softcelandroid.info/ (5)
  • softcelandroid.info/ (5)
  • softcelandroid.info/ (5)
  • softaxianhtc.info/si (5)
  • softcelandroid.info/ (5)
  • softcelandroid.info/ (5)
  • softcelandroid.info/ (5)
  • softaxianhtc.info/si (5)
  • softcelandroid.info/ (5)

Navigation

  • John Mercier
  • Weblog
  • Login

©2010 John J Mercier.

Designed by Free CSS Templates. Template by E. Strokin. Powered by Roller Weblogger 4.0.1.