Programming Challenge #2
Level: Really Easy!
Challenge: Create a program that asks the user for their name, and once they enter it, says "Hello, [personsname]" with the name that the person entered being where [personsname] is.
Every person who submits a program will win, the reward is 30LGG. If you make your program do any special other little things, you'll get some bonus LGG!
This contest has an unlimited amount of winners, and is open to anyone! If you're just learning programming, you can start with Challenge #1, and progress through them from there, as you'll learn programming as you go!
Enjoy!
Some helpful links:
How To Take User Input in C++
How To Take User Input in Java
How To Take User Input in Python
How To Take User Input in VB.NET
How To Take User Input in PHP
Current Winners List:
1.) The Unintelligible
2.) C0FFINCASE
3.) einstein95
4.) Isonyx
5.) Smithno13
6.)
7.)
8.)
9.)
10.)
11.)
12.)
13.)
14.)
15.)
Past Challenges:
http://forum.logicalgamers.com/progr...supereasy.html
Results 1 to 38 of 38
- 23 May. 2013 07:47pm #1
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 0.25
Programming Challenge #2 - Level: ReallyEasy!
Last edited by 323; 25 May. 2013 at 01:09pm.
- 23 May. 2013 09:34pm #2
$lolz = InputBox("", "Enter your name, gewd sir.")
$lolz &= '.' ; Concatenate period to complete sentence
ConsoleWrite("Hello, " & $lolz & @CRLF)
autoit this time.Last edited by The Unintelligible; 23 May. 2013 at 09:37pm.
I'm lightning on my feet
- 23 May. 2013 09:43pm #3
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1.25
- 23 May. 2013 09:44pm #4
Global Moderator Literally Hitler
Morbidly Obese
Bird Jesus
- Age
- 35
- Join Date
- Nov. 2009
- Location
- The Land Of Ooo
- Posts
- 8,569
- Reputation
- 711
- LCash
- 1.37
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
int main() {
string input = "";
cout << "Please enter your name:\n";
getline(cin, input);
cout << "Hello, " << input << endl << endl;
return 0;
}
- 23 May. 2013 09:46pm #5
CRLF is control feed. It's common in any major programming language. Just in AutoIt it's "@CRLF" rather than \n.
Typically known as the newline sequence. But yeah. AutoIt is alright.I'm lightning on my feet
- 23 May. 2013 09:47pm #6
- 23 May. 2013 09:53pm #7
Global Moderator Literally Hitler
Morbidly Obese
Bird Jesus
- Age
- 35
- Join Date
- Nov. 2009
- Location
- The Land Of Ooo
- Posts
- 8,569
- Reputation
- 711
- LCash
- 0.25
- 23 May. 2013 09:56pm #8
- 23 May. 2013 10:00pm #9Code:
name = raw_input("What's your name, you foolish fool wearing the foolishly foolish clothes?\n") print("Hello, "+name) if name == "Franziska von Karma": print("Pheonix Wright, FTW!")
Last edited by einstein95; 23 May. 2013 at 10:02pm.
- 23 May. 2013 10:01pm #10
Global Moderator Literally Hitler
Morbidly Obese
Bird Jesus
- Age
- 35
- Join Date
- Nov. 2009
- Location
- The Land Of Ooo
- Posts
- 8,569
- Reputation
- 711
- LCash
- 0.69
- 24 May. 2013 04:45am #11Code:
import java.util.Scanner; public class Input { public static void main(String[] args) { String name; Scanner receive = new Scanner(System.in); System.out.println("What is your name? "); name = receive.next(); System.out.println("Hello, " + name); //Added Functionality System.out.println("Also, Flareboy is a fag."); } }
I don't get tired.
- 24 May. 2013 05:16am #12Code:
<script type="text/javascript"> while((name = prompt('What is your name?')).length == 0){} alert('Hello, ' + name); </script>
- 24 May. 2013 08:14am #13
So, in the process of completing the first challenge, I got inspiration and started doing random crazy shit... I submitted it to the other thread, but this seems to be more applied here...
Just modified it to include the location question.
Python 3.1
Code:import random output = open('out.txt', 'w') id = str(random.randint(100000, 999999)) unit = str(random.randint(1, 13)) name = input('What is your name? ') print('Why hello there ' + name + '.') loc = input('What is your location? ') print('Deploying Unit#' + unit + ' to ' + loc + '. Please wait where you are for retrieval.') print('You are no longer ' + name + '. You will now be known as Prisoner#' + id + '.') answer = input('Do you accept? Type Yes or No ') if 'yes' in answer.lower(): print('Enjoy your stay!') x = 'compliant' else: print('Prisoner#' + id + ' is noncompliant. Beginning execution sequence.') x = 'non-compliant. Prisoner #' + id + ' executed' output.write('Subject is ' + name + ' of ' + loc + '\n' + 'Subject will now be known as Prisoner#' + id + '\n' + 'Subject is ' + x) output.close()
Last edited by Smithno13; 24 May. 2013 at 06:35pm.
LG's resident grammar nazi.
Need warez? I can probably find it for you. Throw me a PM.
For all of my sales, if you refer a buyer to me and they make a purchase, you can recieve 5%
- 24 May. 2013 08:47am #14
- 24 May. 2013 03:03pm #15
- 25 May. 2013 01:10pm #16
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1.01
Sweet, updated the winners list, and sent out the LGG!
Get ready for Challenge #3, coming your way soon!
Still open for anyone wanting to complete it
- 25 May. 2013 01:18pm #17
- 25 May. 2013 04:23pm #18
- Join Date
- Apr. 2013
- Location
- Minnesota
- Posts
- 1,325
- Reputation
- 114
- LCash
- 0.63
Code:#Python 3.3 response = input("What is your name?") print("hello ", response)
https://discord.gg/TvN6xUb ~ chat on discord pls.
- 25 May. 2013 04:28pm #19
- 26 May. 2013 02:15am #20
- 26 May. 2013 02:20am #21
- 26 May. 2013 02:26am #22
I mean yeah, but technically it says the output should be "Hello, [personsname]" not "Why hello there ' + name + '.'"
It's pretty irrelevant and really I wasn't bringing it up as a serious concern or anything but for the sake of argument I don't think by technicality it fits the criteria of the challenge.
Again, not that it matters. Like I said, was interesting the twist he put on it.I don't get tired.
- 26 May. 2013 02:33am #23
Except his program has the same denotation as the challenge criteria. It doesn't matter how you say hello, as long as you're greeting the user based on their input. Like saying "hi" in Spanish or English.
I think it's a serious concern for you when you feel the need to bring up needless technicalities that are tangent to the actual challenge. Things can be done in a multitude of ways. His was done a little differently. Uniquely.I'm lightning on my feet
- 26 May. 2013 03:24am #24
- 26 May. 2013 03:29am #25
- 26 May. 2013 03:38am #26
- 26 May. 2013 03:43am #27
- 26 May. 2013 03:51am #28
- 26 May. 2013 04:00am #29
lol not even semantics. it's actually just cryptic insults.
All I was doing was amending your original statement because like I said the code is technically correct. Not even taking it far. It was basically over after you had further clarified yourself. Saw "calm yourself" and decided to poke fun at that considering I was never worked up at all in this thread.
I assume you got defensive and decided to draw this out by saying "you sound ridiculous."
But if you really look at the situation, you're the one taking it far. Not me.
As far as I'm concerned I don't care about this whole debacle. So yeah.I'm lightning on my feet
- 26 May. 2013 04:03am #30
- 26 May. 2013 04:06am #31
- 27 May. 2013 07:37pm #32
"technically correct" ... are you missing the point?
Create a program that asks the user for their name, and once they enter it, says "Hello, [personsname]" with the name that the person entered being where [personsname] is.
So the code is technically incorrect as it does not follow the assigned challenge.
- 27 May. 2013 07:48pm #33
The point here was made pretty clear. It does technically qualify. It doesn't matter about the manner in which he completed the challenge in. He did it in his own unique way. All criterions were satisfied. Flare awards extraneous elements.
There is nothing wrong in alternating in a non-serious challenge. Saying otherwise is just being really pedantic. I don't know how this is so hard for you to understand.
name = input('What is your name? ')
print('Why hello there ' + name + '.')
He literally has to change this one key part, to this:
name = input('What is your name? ')
print('Hello, ' + name + '.')
I rest my case here.Last edited by The Unintelligible; 27 May. 2013 at 07:58pm.
I'm lightning on my feet
- 28 May. 2013 02:45am #34
- Join Date
- Apr. 2010
- Location
- When freedom is outlawed only outlaws will be free
- Posts
- 5,113
- Reputation
- 195
- LCash
- 1.33
HEY GUYS NEW RULE FROM NOW ON AS LONG AS IT GENERALLY FITS THE CRITERIA I'LL ACCEPT IT.
I really don't give a shit if it says Hello or Hi or Hola or whatever the hell you want to write, as long as it's generally it.
- 28 May. 2013 03:13am #35
It's funny because the solution he submitted qualified much more broadly than just "generally." It's not a general solution, it pretty much had every necessary facet. People are just griping for no reason being overly technical and whatnot.
Thanks for clarifying though.I'm lightning on my feet
- 28 May. 2013 06:39am #36
I'm proud, my drunken code has inspired pages of argument.
Thanks for defending me, I guess?LG's resident grammar nazi.
Need warez? I can probably find it for you. Throw me a PM.
For all of my sales, if you refer a buyer to me and they make a purchase, you can recieve 5%
- 29 May. 2013 06:09pm #37
- Join Date
- Apr. 2013
- Location
- Minnesota
- Posts
- 1,325
- Reputation
- 114
- LCash
- 0.45
When we going to see another challenge?
https://discord.gg/TvN6xUb ~ chat on discord pls.
- 28 Jul. 2013 03:11pm #38PHP Code:
<?php
$name = $argv[1];
echo 'Hello, ' . $name . ".";
?>
1st file:
PHP Code:<html>
<body>
<form action="php.php" method="post">
Name: <input type="text" name="personsname">
<input type="submit">
</form>
</body>
</html>
PHP Code:<html>
<body>
Hello, <?php echo $_POST["personsname"]; ?>!
</body>
</html>Last edited by imbaimba; 28 Jul. 2013 at 03:17pm.