I'm currently taking a class at my high school, that teaches C# and .net framework, python, etc. I have to make a program that plays "Rock, Paper, Scissors" against a person using return-methods as the project for this unit.
I keep running into an error on Microsoft Visual Studios 2015 that says No Overload for method 'PCRandomizer' takes 1 arguments
I'm still really new to this whole system so I'm having a hard time understanding this, but my program (so far) is like this;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Rock__Paper__Scissors
{
public partial class rockPaperScissors : Form
{
public rockPaperScissors()
{
InitializeComponent();
}
int playerChoice;
// Variable to indicate what the choice is.
int pcChoice;
private int PCRandomizer()
{
// Create a Random Object.
Random rand = new Random();
// Get the rand integer between 1 and 3.
// 1 and the PC has chosen Rock.
// 2 and the PC has chosen Paper.
// 3 and the PC has chosen scissors.
pcChoice = rand.Next(1, 3);
// This returns the value back to the main method.
return pcChoice;
}
private void playerRockPic_Click(object sender, EventArgs e)
{
playerChoice = 1;
PCRandomizer(out pcChoice);
}
private void playerPaperPic_Click(object sender, EventArgs e)
{
}
private void playerScissorsPic_Click(object sender, EventArgs e)
{
}
private void resetButton_Click(object sender, EventArgs e)
{
}
private void exitButton_Click(object sender, EventArgs e)
{
// Close the Form
this.Close();
}
}
}
I apologize for the long post, but I'm getting pretty desperate as this is already a day behind schedule and several people in my class also have this issue.
I found this page here, but I did not understand it.