Over the last two days I have spent a few hours programming a simply checkers onto python. Overall, the project has definitely taught me many lessons about organising my variables and also the use of decorators although none of them got into the final code of the application. If anyone is trying to make the application themselves, I would recommend you take the grid code and then try implement the code yourself. In order to improve the efficiency of your code, I would also recommend you to not have a separate 2d array in order to conduct all of your…
I havent posted an article in a long time because of schoolwork so I thought I would free 2 hours today to quickly program snake and upload it. This is the result. Since my last post, I have been making progress on a course in web development where I’ve been learning HTML, CSS, JS and node.js where I have learnt how to run a proper server with endpoints and have a mongoose server attached onto it so expect future articles on web development. Furthermore, I am doing a free CourseEra machine learning course on CourseEra which has been very useful…
Rising popularity in technology over the last decade has seen massive growth in all things related to computer science. This has given birth to many sub-branches such as data science, SaaS (software as a service) and also machine learning (AI). As a result, data is being extracted on us constantly, and possibly, more data than you are aware of: did you know apps have full access to your camera and microphone (even when you aren’t aware of it being on)? Apps use it to track your eyes and to overhear your conversations- a snooping method of data extraction. Most people…
This is my very condensed guide on how to start your exercise journey. It isn’t going to be easy but if it was easy everyone would have chiselled 6 packs and could deadlift 500kg but that isn’t the case. This is going to push you out of your comfort zone but if you have the consistency I assure you that you will see amazing results.
Why I believe I have the right to talk about this: I had been overweight and near obese my entire life. By year 5 I was somewhere between 70–80kg and it had a really bad…
If you don’t know, the game of life is a simulation for population.
The wikipedia page explains the very basic rules of the Game of Life and how you decide the states of a tile.
This video also gives a visual explanation if you’re a visual learner.
A living state is black and a dead state is white. We
I will first describe what’s happening and then show the code afterward.
This is a large project that me and a friend in school conducted. This is pretty funny because we had plans on doing this over several months and 7 days later we have the entire thing completed. I must say, this would not have been possible if it weren’t for the help of my friend Edwin. Firstly we abstracted the entire game since this is a very complex game to code and we decided that I would be responsible for the interface(what the user can see) while Edwin…
This may seem like a very strange question to be asking but I feel like it is very hard for someone to feel true happiness and normally it is fleeting in nature. The google definition of happiness I believe is pretty dull and doesn’t hit on the things I want to cover. I believe happiness isn’t the feeling of happiness but more the lack of problems in ones life and when it is put that way, I think everyone will find it hard to say they are truly ‘happy’. A problem can range from something large like the fear of…
Using MatPlotLib, I will teach you how to make a graph timing the speed of quicksort on varying lengths of lists on Python.
If you want an explanation on my quicksort code, I have made a separate article, however I am going to explain how to get it onto a graph and relate it to the O notation of quick sort. As you can see on the graph (which is the output graph I got), there is some white noise going on especially towards the larger datasets, and that is because of the arrangements being particularly good or bad. …
I have been working on a bit of larger project recently so I haven’t been able to upload on this however I thought I would do something short and simple so I have quickly programmed a very simple stack in about 5 minutes on Python which im going to go over.
A stack is a data structure(like an array, hash table, binary tree etc.) which works on a last in first out system. This means the value most recently added to the list will become the first value to leave this list. This has very useful real world applications…
Don’t get intimidated by the code, most of this was generated by me when I converted my UI file from QtDesigner into python code using the terminal (and scroll past it for the description).
valids = {'x': '[\'x\', \'+\', \'÷\', \'^\']', '+': '[\'x\', \'+\', \'÷\', \'^\']',
'/': '[\'x\', \'+\', \'÷\', \'^\']',
'^': '[\'x\', \'+\', \'÷\', \'^\']', '-': '[\'x\',\'÷\', \'^\']',
'(': '[\'x\', \'+\', \'÷\', \'^\',\'(\']'}from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QMainWindow class Ui_MainWindow(QMainWindow): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(300, 450) palette = QtGui.QPalette() brush = QtGui.QBrush(QtGui.QColor(165, 163, 158)) brush.setStyle(QtCore.Qt.SolidPattern) palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.WindowText, brush) brush = QtGui.QBrush(QtGui.QColor(255, 255, 255)) brush.setStyle(QtCore.Qt.SolidPattern)…
Prospective Computer Science Student