Posts

Showing posts from March, 2024

i missed my practicals pt.2

Image
Works on pygame. Install pygame using cmd:       pip install pygame Download and run the code. This is an application of Biot-Savarts law on each side using the result-                          B = μo NI(sinA + sinB)/ 4πD      (direction is in/out of the plane) Code finds cursor's position on the Cartesian plane and calculates the value of A, B and D accordingly from each side of polygon. I have also converted the screen point system into cartesian system such that the center of the window now behaves as origin (0,0). Each side is 100 units and positions of vertex are found by taking parametric positions of circumcircle of the polygon (parameter being multiple of central angle (360/n)).                        circum radius = a/sqrt(2-2cosA)                     : a = side length and A = 360/n                     : n = no of sides. (Yes i derived this, i wasted so many goddammed hours on it, i should have just googled it, though it was a good mental exercise, got a revision of geo

tictactoe gui

Image
ONLY ONE WAY TO DEFEAT IT, IF I WANT I CAN MAKE IT FULL PROOF, BUT JUST LIKE OLD LADY SAINT MISS SUJATA ONCE SAID-  "Draw hi bas hoga to maza kya". 1. Download the file . 2. Extract all. 3. Run ultimate.py . If you find the loophole, mail me at diptanshu.1406@gmail.com, I will send you 50 rupees. Don't waste your time on recreating useless games. dm

I FINALLY MADE IT! (tic tac toe)

Image
I finally made single player tic tac toe.  If you are really lonely computer will play with you. I always wanted to make this, ever since I started python, today its done. mera bachpan ab pura hogya (I will be 18 in 3 months). Its simple text based version. Putting it on GUI would be annoying, will probably do it sometime later using pygame, as the basic logic behind it is ready and done. The code isn't optimized so well, because I was so happy it worked consequently I stopped putting efforts on it. Just download it, and run the code . dm

#4ab: Coding in Python {Roman-Decimal [GUI]}

Image
This simple code converts Roman Numerical into Decimals and vice versa real-time. Graphics User Interface, use cursor to switch between the modes. No additional libraries are required, simply download the file and run it. Chat GPT for GUI part, i keep forgetting how to use tkinter. Special thanks to Miss Sujata for giving me the idea for this project. dm