Jump to content

Search the Community

Showing results for tags 'paper'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. Challenge: Create the smallest number lines of AutoIt code to create a paper, rock, scissors game in which you ask for the user's choice and generate a random result for the computer. Good luck. Note: Mat can't play in this game. Sorry! If this needs to be moved then by all means move it to an appropriate location. Thanks.
  2. Created in only 2 lines. The first Console.WriteLine() is not included as it's there just to report the valid values. using System; namespace RockPaperScissorsFinal { internal class Program { private static void Main() { Console.WriteLine("(1) Rock \n(2) Paper \n(3) Scissors\nEnter your choice: "); do { // Nested ternary statements. What a pain to read , but hey it's only 2 lines ;) Also this uses what we've already learnt. string[] answers = { Console.ReadLine(), "Rock", "Paper", "Scissors", new Random().Next(1, 3).ToString() }; Console.WriteLine(answers[0] != "1" && answers[0] != "2" && answers[0] != "3" ? "Please enter a valid value next time." : "You chose {0} and the computer chose {1} with an outcome of " + (answers[0] == answers[4] ? "the same" : (answers[0] == "1" && answers[4] == "3") || (answers[0] == "2" && answers[4] == "1") || (answers[0] == "3" && answers[4] == "2") ? "winning" : "losing") + ".", answers[int.Parse(answers[0])], answers[int.Parse(answers[4])]); } while (true); } } }
×
×
  • Create New...