Showing posts with label Gurpreet. Show all posts
Showing posts with label Gurpreet. Show all posts

Saturday, 28 March 2015

Dots and Boxes game with python and pygame!

Yes! it is Dots and Boxes this time and its really working and that too without those complex algorithms that you get to see when you search the web.

My Algorithm:

1. Let the user play first.
2. When the computer gets its turn, it first searches for boxes that can be completed in one move.
3. It completes one of such boxes if found else it finds out the 'two-sided' boxes (those which have two sides marked) and stores in a list.
4. Now the list stores the boxes which will lead the computer to lose one precious point to the user.
5. The computer dares not even to touch the boxes and finds the lines which are safe to mark.
6. If the computer finds no safe lines then it finds out the chains of boxes which the user can form if the computer takes its turn.
7. Then it finds out the smallest chain and marks one line in it to minimise the loss.
8. This way, the computer has a good chance of winning and this is an enjoyable game.

HIT +1 IF YOU LIKE THE IDEA

Give it a try: Download




Thursday, 12 March 2015

Task 3 SOLVED!

This is the solution to the Task3.
I made this as Many people were requesting for it.

The Program asks the number of students in all the Classes and then conducts mathematics quiz for all of them. It calculates the score,average score and stores them in a tuple with the name of the student along with the last 3 scores.
The program then stores the tuple in a list which is different for each class.

This information  accessed after the completion of the quizzes.

Download the program here: Datafilehost.

The following screen shots show the program working. (I used small no. of questions and students for the output and only a part of the output is being shown here as it was too long. The program actually asks 10 questions from each student.)




 DON'T FORGET TO HIT +1



--**--UPDATE--**--


In response to the request made by MyPerryThePlatypus I have just converted the code to work with Python3.


Download it here.

Follow this blog if you think it is worth it and/or like it on Facebook here.

E-mail me here.




Tuesday, 10 March 2015

HTML PageMaker GUI v1.1

Hello Python Lovers.
Today After quite some-time I am back with a new Tkinter GUI python script.

This program provides an easy to use GUI for my older page maker.

So Download it here and give it a try.

Happy HTML Pagemaking...

And...
Don't Forget to hit +1





Next Expected Post: Solution to Task 3. See details here.

Tuesday, 30 December 2014

War Of The Numbers - New version! (Update)

This program here is an update to the older war of the numbers.
It contains many changes:

Power-ups : The Golden Shot, The Shield, Freeze , Reverse

Code  Optimization : Performance is now better due to code optimization which now doesn't wastes any processing cycles.

Menu : A Menu created.

Improvements coming in the near future:
Full-screen, Better sound, Objectives and achievements, High Scores, etc.

Download here: http://goo.gl/JHwRmS

The game is action:





Thursday, 25 December 2014

Square Root of a number with Python. - NO IN-BUILT FUNCTION USED!

Yes! I made the program after typing some tricky code-lines.
This program really does the task without using in-built functions.

Instead, It uses the Long-Division method taught at school.
But it is not as accurate as the in-built functions. But it is not as much different. The Function I designed first converts the number into 2-digit numbers and then operates using the long-division algorithm.

Please like Us on Facebook here if you want to support Python Palace.

To show the accuracy of the calculations, I have also given the results produced by the In-Built Function (pow) along with my Function's output.

Credits to +NavdeepSinghQUADD for the idea of this program.

Download here: http://goo.gl/rxLa4V   (UppIT.com)

Thx for visiting. Keep coming...



Tuesday, 2 December 2014

Equation of an Ellipse with python

Welcome readers,

I have another program to share.
This program will find the equation of an ellipse for you.
Just provide the values you have.

This program supports 8 combinations of values and can find the equation of ellipse if it is given sufficient values required.

Requires values:

Vertices and Foci

or

Equation of major axis and a and b

or

Length of major axis and Foci

or

Length of minor axis and Foci

or

a and Foci

or

Equation of major axis and 2 points through which the ellipse passes

or

Eccentricity and  Equation of major axis and a point lying on ellipse

or

Foci and Eccentricity



** This program can find the equations which have 1/something as the coefficients of the variables and is not reliable for coefficients like something(1)/something(2) as it converts such coefficients to 1/(something(1)/something(2)) and the value returned is approximate and not exact.






 Download Program: Datafilehost


Like Python Palace on Facebook

And

don't forget to join this site.

Gurpreet Singh




Sunday, 30 November 2014

See the new game I'm working on! - Fruits everywhere with pygame...

This is another game which is purely made with python and pygame.

This is a fruit collection game that would help you kill time and also learn some programming tactics if you see the source code carefully.

The code is self explanatory so i didn't comment.
I will if someone wants me to do so.

The game consists of an empty fruit basket which you need to fill up by collecting the free falling fruits. Beware of the bombs which take away 10 Scores and the cool bombs which rip you of one live. Lives are precious and you get three.
Lost a life? You have a chance to get one falling along those fruits but it takes a long time to appear.

Your high scores are stored and don't get cleared when you close the game.

This version currently works only with linux (posix). Sorry for windows users.
E-mail me here and I will post a version for windows too! if you find the game worth doing so.

The game ain't tough. It's fun. Enjoy...
Download : datafilehost