Saturday, February 21, 2015

coding challenge Chess

I tried to make a chess game with vb.net under visual studio 2013.


Info:
I wrote this application in vb.net. As you maybe can see the gui is dynamical generated. I use a lot of panels.
I just needed about 2000 rows for this result. There is one interface called Figure and all the others will extend it.

If you are interested in the source code:
https://github.com/marcin96/Marcins_Chess

If you have questions please write.
Maybe you wonder why I haven't used the standart MVC and didn't separate the model from the gui as usually. My intension wasn't to create a real chess app. I wanted to show how you can code an evealuating system for figures and their possible moves. As you can see I used the hole field as an Array and calculated then with with formules for each group of figures their possibilities at the play time.

Coding challenge Pong

I made a little Pong game, in Java and Slick2D



Info:
A very basic application every programmer knows. Originally developed by a swiss student in the 20th century. I wrote it in java 8 under Netbeans with slick2D a child library of lightweight java game library.

Coding challenge Tetris

I made a little Tetris game in Java and Slick2D




Info
Propably the most famous computer game in the world. Tetris.
I needed about one day to write it.
Heere are my Tipps:

  • Strukturize the background in rows and comlumns with coordinates.
  • Write a class for one Cube. This is necessary, beacause after your figures are at the bottem the app should count only the cubes per row.
  • Use a Timer for the pseudo gravity.
  • To rotate the figures , please remember that you should do it centered.
For me it was a lot of fun, and only about 400 rows of java code. So when you have a fiew minutes, then do it. It will be great.

used: Java 8 and Slick 2D

python to msi ~(Windows Installer)

Info:
When you develop a lot of python applications and you want that your next script is close sourced, then you are right with this article. I explain you have to compile a python application and generate a msi Windows installer. For that i use cx_Freeze.

Built Script:

company_name = 'Marcins Programms'
product_name = 'Sokrates'

bdist_msi_options = {
    'upgrade_code': '{Banana-rama-30403344939493}',
    'add_to_path': False,
    'initial_target_dir': r'[ProgramFilesFolder]\%s\%s' % (company_name, product_name),
    }

path = sys.path
build_exe_options = {
"path": path,
"icon": "brain.ico"}

base = None
if sys.platform == "win32":
    base = "Win32GUI"
 
exe = Executable(script='Sokrates__PYMATH.py',
                 base=base,
                 icon='brain.ico',
                )

setup(  name = "Sokrates",
        version = "1.1",
        description = "Powerfull Calculator for all plattforms",
        executables = [exe],
        options = {'bdist_msi': bdist_msi_options})


run this script with a batch file:
py build.py build
py build.py bdist_msi


You need cx_freeze