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
Hybrid View
- 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:47pm #5
- 23 May. 2013 09:53pm #6
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 #7
- 23 May. 2013 10:01pm #8
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
- 23 May. 2013 09:46pm #9
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 10:00pm #10Code:
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.
- 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:18pm #16
- 25 May. 2013 04:23pm #17
- Join Date
- Apr. 2013
- Location
- Minnesota
- Posts
- 1,323
- 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 #18
- 25 May. 2013 01:10pm #19
- 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
- 28 May. 2013 02:45am #20
- 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 #21
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 #22
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 #23
- Join Date
- Apr. 2013
- Location
- Minnesota
- Posts
- 1,323
- 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 #24PHP 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.