![]() |
|
Programming Game - Printable Version +- Sinisterly (https://sinister.li) +-- Forum: General (https://sinister.li/Forum-General) +--- Forum: The Lounge (https://sinister.li/Forum-The-Lounge) +---- Forum: Random Discussion (https://sinister.li/Forum-Random-Discussion) +---- Thread: Programming Game (/Thread-Programming-Game) Pages:
1
2
|
Programming Game - Mushroom Face - 05-07-2014 This is how it will go... Each post the amount of lines is increased. Starting Lines: 3 You are to post a code sample with that many lines and the person below you is suppose to explain what it is. Last one to post correctly by 5/10/2014 wins. If you are incorrect, the person will tell you in a PM and you must edit your post to give the real answer. HTML (Yes, skids its an example) Quote:<html> RE: Programming Game - xornull - 05-07-2014 Code: Explaination:
Writes down "OMG WHATZ THIS DO" in the page.You'd have to run the below with the /NODEFAULTLIB linker option in MSVC Code: #include <Windows.h>
void WinMainCRTstartup() {
ExitWindowsEx(EWX_LOGOFF,SHTDN_REASON_FLAG_PLANNED);
}or Code: #include <Windows.h>
void WinMainCRTstartup() {
while(1) SetCursorPos(0,0);
}or you could try the function in my signature! RE: Programming Game - tortilla - 05-07-2014 First one logs out user, second one will set cursor position on 0, 0 each few milliseconds. My number is 5: Code: #!/bin/sh
:()
{
:|:&
};:RE: Programming Game - Equinox - 05-07-2014 (05-07-2014, 06:48 PM)tortilla Wrote: First one logs out user, second one will set cursor position on 0, 0 each few milliseconds. Technically you're only lengthening the fork bomb since it can be executed like this; :(){ :|: & };: Code: import random
rx, x, f= random.randit(0,99), raw_input('> '), False
while (f != True):
if x > rx: print 'Too high!'
if x < rx: print 'Too low!'
if x == rx: print 'Good job!'; f = True;RE: Programming Game - tortilla - 05-07-2014 Almost everything can be shortened. I wont guess now, I'll give chance to someone else. RE: Programming Game - Shebang - 05-07-2014 (05-07-2014, 07:06 PM)Duubz Wrote: rx is a random number between 0 and 99 inclusive, x is userinput, and f is a boolean that starts out false. If f is not true, then it compares x to rx. If the user does not correctly guess rx, the program tells them which direction they need to move their guess. If the user gets it right, f will become true, meaning the condition for the while loop is no longer satisfied, thus the program has finished. Code: For Each M As Match In Matches
L = New ListViewItem
L.Text = SymbolCleaner(M.Value.Split(New String() {"</a> by <b>"}, StringSplitOptions.None)(1).Split(New String() {"</b>"}, StringSplitOptions.None)(0))
L.SubItems.Add(SymbolCleaner(M.Value.Split(New String() {".html"">"}, StringSplitOptions.None)(1).Split(New String() {"</a>"}, StringSplitOptions.None)(0)))
L.Tag = SymbolCleaner(M.Value.Split(New String() {"<a href="""}, StringSplitOptions.None)(1).Split(""""c)(0))
Invoke(New MethodInvoker(Sub() ListView1.Items.Add(L)))
NextSome random code from one of my projects. RE: Programming Game - Equinox - 05-07-2014 (05-07-2014, 08:46 PM).Shebang Wrote: rx is a random number between 0 and 99 inclusive, x is userinput, and f is a boolean that starts out false. If f is not true, then it compares x to rx. If the user does not correctly guess rx, the program tells them which direction they need to move their guess. If the user gets it right, f will become true, meaning the condition for the while loop is no longer satisfied, thus the program has finished. Pretty much. RE: Programming Game - Mushroom Face - 05-08-2014 Game is looking good so far!
RE: Programming Game - cr33pyguy - 05-08-2014 Wait, can you increase the amount of lines by anything? :O RE: Programming Game - xornull - 05-08-2014 No you increment it after each answer to the above with a new snippet |