STOP, the smallest playable game

Home Page Forums Computers and Stuff In code we trust STOP, the smallest playable game

This topic contains 62 replies, has 2 voices, and was last updated by  gucci belts 6 days, 12 hours ago.

Viewing 15 posts - 1 through 15 (of 63 total)
  • Author
    Posts
  • #242 Reply

    albertzakhia
    Keymaster

    Source Code VB Snapshot[/caption]” alt=”VB Snapshot” />

    Back in the good old days of DOS and Microsoft BASIC (MSBASIC), the BASIC written by Bill Gates himself, someone somewhere held a coding competition: who can write the ‘smallest playable game’. I still remember this game, although I do not remember if it won or not, but here it is, modified to be runnable with Visual Basic, under Visual Studio.

    How to play?
    All you have to do is run the code. On the console window, wait for the GO, then try typing the word STOP as fast as you can. You have 1 second. If you are able to type STOP in under 1 second, you win and your typing time is displayed, other wise you lose. But then, you can always run it again.

    How to write the code?
    Easy, in Visual Studio, or any VB, create a new project (File -> New Project) then select VB on the left pane finally select CONSOLE APPLICATION on the right, then OK. Now copy the whole code from below and paste as-is in the page MODULE1.VB. You won’t need to use any of the imports so paste replacing all. Finally, click the function key [F5] to run the cise and wait for yhe signal. Start typing!

    Minimal computer requirement: CPM, 8086 4 MHZ CPU running Microsoft DOS and 512K of RAM.

    Enjoy.

    Compliment of Albert Zakhia.

    Sub Main()
    Dim s = “”
    Dim t = New Stopwatch
    Dim pos As Int16
    Dim key As Char
    While True
    s = “”
    Console.WriteLine(“Press [X] to exit or any key to start!”)
    key = Console.ReadKey().KeyChar
    If Char.ToUpper(key) = “X” Then Exit While
    pos = 1
    Console.WriteLine(“GO!”)
    Console.SetCursorPosition(11, Console.CursorTop)
    Console.Write(“|”)
    t.Restart()
    While Not s.ToLower().Contains(“stop”) And t.ElapsedMilliseconds <= 1000 If Console.KeyAvailable Then s = s & Console.ReadKey().KeyChar Console.SetCursorPosition(pos, Console.CursorTop) pos = pos + 1 Threading.Thread.Sleep(100) End While If t.ElapsedMilliseconds > 1000 Then
    Console.WriteLine(“X – Timeout, you lose”)
    Else
    Console.WriteLine(“{0}Great! You typed: {1} in {2} seconds”, vbCrLf, s, t.ElapsedMilliseconds / 1000)
    End If
    While Console.KeyAvailable
    Console.ReadKey()
    End While
    End While
    End Sub
    End Module

    • This topic was modified 2 years, 4 months ago by  albertzakhia.
    • This topic was modified 2 years, 4 months ago by  albertzakhia. Reason: Adding colors
    • This topic was modified 2 years, 4 months ago by  albertzakhia.
    • This topic was modified 2 years, 4 months ago by  albertzakhia.
    • This topic was modified 2 years, 4 months ago by  albertzakhia.
    • This topic was modified 2 years, 4 months ago by  albertzakhia.
    • This topic was modified 2 years, 4 months ago by  albertzakhia.
    • This topic was modified 2 years, 4 months ago by  albertzakhia.
    • This topic was modified 2 years, 4 months ago by  albertzakhia.
    #46813 Reply

    adidas gazelle

    I intended to write you that little bit of note to help thank you yet again with the unique opinions you’ve discussed in this article. It is particularly generous with you to provide publicly exactly what a number of us might have distributed as an e-book to generate some bucks for themselves, certainly considering the fact that you could possibly have done it if you considered necessary. The strategies additionally served as the easy way to be aware that many people have a similar eagerness just like mine to grasp a great deal more with regard to this issue. I’m certain there are millions of more enjoyable instances in the future for individuals that read through your blog.

    #47301 Reply

    golden goose outlet

    Thank you a lot for providing individuals with an extremely remarkable possiblity to read critical reviews from this blog. It is often very enjoyable plus jam-packed with a good time for me and my office fellow workers to visit your web site really thrice in 7 days to read the latest guidance you will have. Not to mention, I am always contented with the special concepts you give. Certain 3 ideas in this posting are unequivocally the best I’ve had.

    #48251 Reply

    yeezy boost 350 v2

    I wanted to post you a little bit of remark in order to thank you very much as before on your pleasant solutions you have shared in this article. It is simply surprisingly generous of you to offer unreservedly what exactly most people would’ve made available for an ebook to help with making some profit for their own end, precisely since you might well have done it if you desired. The tricks also worked to be a fantastic way to fully grasp that other individuals have similar dream the same as mine to know lots more regarding this issue. I believe there are a lot more fun occasions ahead for folks who read through your blog.

    #48900 Reply

    longchamp

    I intended to write you this very small observation just to give many thanks once again just for the fantastic principles you have documented in this case. It is certainly incredibly open-handed of people like you to provide extensively all that some people could possibly have distributed as an e book in order to make some bucks for themselves, especially considering that you could possibly have tried it if you wanted. Those tricks as well acted like the fantastic way to comprehend the rest have the identical eagerness like my personal own to understand more and more with respect to this condition. Certainly there are several more enjoyable times in the future for folks who read carefully your blog.

    #49282 Reply

    fila shoes

    I together with my guys ended up analyzing the nice tips and tricks from your web site then all of the sudden developed an awful feeling I had not thanked the site owner for those strategies. All the women had been so stimulated to see all of them and now have certainly been using these things. Appreciation for being so helpful as well as for having this form of tremendous themes millions of individuals are really eager to know about. Our honest regret for not expressing appreciation to earlier.

    #49791 Reply

    yeezy boost

    That is the correct blog for anyone who needs to search out out about this topic. You understand so much its almost hard to argue with you (not that I really would need匟aHa). You positively put a new spin on a topic thats been written about for years. Great stuff, simply nice!

    #49955 Reply

    michael kors outlet

    I truly wanted to post a note to thank you for all of the marvelous points you are writing on this website. My considerable internet search has finally been recognized with really good details to talk about with my friends and classmates. I ‘d declare that most of us website visitors actually are undoubtedly fortunate to dwell in a fabulous website with so many special people with beneficial basics. I feel very much fortunate to have used the webpages and look forward to so many more pleasurable times reading here. Thanks a lot again for all the details.

    #50337 Reply

    yeezy shoes

    Thanks a lot for providing individuals with an extraordinarily pleasant opportunity to read critical reviews from this website. It is always so pleasurable and also stuffed with amusement for me and my office peers to search your blog particularly 3 times every week to see the latest stuff you have. And of course, I’m just certainly impressed for the breathtaking advice served by you. Selected 4 points in this posting are clearly the most suitable we have all had.

    #50873 Reply

    adidas tubular

    My wife and i got thankful that Emmanuel managed to carry out his reports through the precious recommendations he made out of your web site. It is now and again perplexing to just happen to be giving out instructions that others have been selling. And we also do know we have got the blog owner to be grateful to for this. The entire illustrations you’ve made, the easy blog navigation, the friendships your site aid to foster – it is all unbelievable, and it’s letting our son in addition to us feel that this issue is pleasurable, and that’s seriously vital. Many thanks for everything!

    #51639 Reply

    hermes belt

    My spouse and i ended up being so thankful Michael could round up his reports while using the ideas he gained from your site. It is now and again perplexing to just happen to be giving away instructions people may have been trying to sell. Therefore we already know we’ve got the website owner to be grateful to because of that. The specific explanations you made, the simple blog navigation, the friendships you can give support to engender – it’s got everything exceptional, and it’s really letting our son and the family do think this article is cool, and that is seriously vital. Many thanks for everything!

    #52223 Reply

    curry 6 shoes

    I needed to draft you that very small remark to say thank you again for these striking thoughts you’ve shown above. It has been quite extremely generous with you to make unreservedly what many of us would’ve offered as an electronic book to get some bucks for themselves, certainly now that you might have done it in case you wanted. These advice in addition acted to provide a fantastic way to be certain that the rest have a similar interest like my own to see very much more on the topic of this issue. I am sure there are numerous more enjoyable periods up front for folks who take a look at your site.

    #52674 Reply

    hogan outlet

    My husband and i were absolutely relieved when John could round up his reports through the entire ideas he made from your web page. It’s not at all simplistic to simply find yourself giving out concepts which people have been making money from. And now we know we now have the website owner to appreciate for this. These explanations you have made, the straightforward blog menu, the relationships your site help to instill – it’s all incredible, and it is letting our son and our family imagine that this theme is cool, which is certainly exceedingly indispensable. Thank you for all the pieces!

    #53251 Reply

    adidas tubular

    Thank you so much for providing individuals with such a remarkable chance to check tips from here. It’s usually very brilliant and as well , full of fun for me personally and my office friends to search your website nearly thrice in a week to read through the fresh stuff you have. Not to mention, I’m so certainly fascinated considering the brilliant tips you give. Some 4 ideas in this posting are without a doubt the most suitable we’ve ever had.

    #54067 Reply

    air max 90

    I want to point out my love for your kind-heartedness for individuals who really need help with in this subject. Your personal commitment to passing the solution across appeared to be wonderfully interesting and have truly empowered some individuals like me to achieve their dreams. This interesting information signifies this much to me and even more to my peers. With thanks; from all of us.

Viewing 15 posts - 1 through 15 (of 63 total)
Reply To: STOP, the smallest playable game
Your information: