"Lying in a featherbed will bring you no fame, nor staying beneath the quilt, and he who uses up his life without achieving fame leaves no more vestige of himself on Earth than smoke in the air or foam upon the water." -Dante Alighieri
This will be for anyone looking for some hints on making a program for app 13 using Python, although the basics should apply to any language.
You should be aware that app13 requires 4 sets of numbers and that the 1st number must be correct before moving on to the 2nd number and so on. The program slows when the proper number is crossed so timing them is important.
The first thing I did was write a simple loop which in python can look like this:
>>> for i in range (11):
>>> print i
This will print out 11 numbers starting with ‘0’ and ending with ‘10’. It’s important to keep in mind that it doesn’t print out 1-11 but rather starts with 0 and ends with 10. If you wanted it to start with a number other than zero simply add it in like this:
>>> for i in range(1,11): # prints out 1-10
The next thing for me was to find out how to open an exe (app13) with python (thanks goes out to nneonneo for this part). I used os.spawnl and it goes a little something like this:
os.spawnl(do something, ‘programToOpen.exe’, ‘programToOpen’, str(i),’1’,’1’,’1’)
The ‘do something’ part is what you want os.spawnl to do with the .exe that you are trying to open and in this case you will want it to ‘pause’ while your loop runs so take a look at your options with os.spawnl (‘pause’ was just an example and not the actual command).
Ok so we need to concentrate on trying to get the 1st number and that is where this part of os.spawnl comes in: str(i),’1’,’1’,’1’) We are going to use str(i) to get that number while we use ‘dummy numbers’ for the remaining 3 numbers. Let’s say we get the 1st number and it’s 123. We will now place that number in the code and move the str(i) to the 2nd position like this:
os.spawnl(do something, ‘programToOpen.exe’,’programToOpen’, ‘123’, str(i), ‘1’,’1’).
If the 2nd number turns out to be 456, we would again move things like this: os.spwanl(do something, ‘programToOpen.exe’,’programToOpen’,‘123’,’456’,str(i),’1’)
and so on.
Now we also need to time the numbers in the app so what I did was us startTime in the program and had it print out the max time, then any number that was “greater than” the last max time.
This should be enough to get rolling with some basics. Loop, open program and print max time. My code was 10 lines for this application challenge. Happy coding!
Cast your vote on this article 10 - Highest, 1 - Lowest
Comments: Published: 15 comments.
HackThisSite is is the collective work of the HackThisSite staff, licensed under a CC BY-NC license.
We ask that you inform us upon sharing or distributing.