C# using Visual studio - Windows Form. If possible step-by-step instructions as
ID: 3775607 • Letter: C
Question
C# using Visual studio - Windows Form. If possible step-by-step instructions as well.
You are to create the classic game of Wheel of Fortune. Your application should consist of 3 players, underlines to represent letters in the puzzle, and the available letters. The initial screen should look something like: Wheel of Fortune Available letters ABCDEFGHIKLMNOPQRSTUMWXYZ Puzzle Solve Player 3 Player 2 Player 1 50 Player 1 Spin or Solve Note: My puzzle is "Pulp Fiction" but pick your own puzzle" Notice that Player 1 goes first (see note at bottom of screen) and can either spin or guess the puzzle by clicking the appropriate button. If Player 1 spins, then the wheel will spin. To represent the wheel, create a random number from 1 to 10. Each will represent a spot on the wheel. Here are the wheel values: Random number 1: $100 Random number 2: S300 Random number 3: S500 Random number 4: $700 Random number 5: S900 Random number 6 S2000 Random number 7: S3000 Random number 8 S5000 Random number 9: -$1000 ll player loses S1000 from his/her total and loses that turn Random number 10: S0 player only loses turnExplanation / Answer
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
textBox1.Text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
textBox17.Text = "$0";
textBox18.Text = "$0";
textBox19.Text = "$0";
}
private void Form1_Load(object sender, EventArgs e)
{
textBox1.Text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
textBox17.Text = "$0";
textBox18.Text = "$0";
textBox19.Text = "$0";
}
public void fun()
{
string s1 = "";
for (int i = 0; i < 26; i++)
{
s1 = s1 + globalvar.arr[i].ToString();
textBox1.Text = s1;
}
string s2 = textBox2.Text + textBox3.Text + textBox4.Text + textBox5.Text + textBox6.Text + textBox7.Text + textBox8.Text;
s2 = s2 + textBox9.Text + textBox10.Text + textBox11.Text + textBox12.Text + textBox13.Text + textBox14.Text + textBox15.Text + textBox16.Text;
if (s2.Equals("back to the future"))
{
s = "Player " + (globalvar.k + 1) + "won and score is " + globalvar.scores[globalvar.k];
second.Show();
}
}
Prompt p = new Prompt();
private void button1_Click(object sender, EventArgs e)
{
int[] rand = new int[10]{100,300,500,700,900,2000,3000,100,-1000,0};
Random r1 = new Random();
if (globalvar.k == 0)
{
int num = r1.Next(1, 11);
if (num < 9)
{
MessageBox.Show("Value is :$", rand[num - 1].ToString());
p.Show();
char let = Prompt.c;
int cou=0;
if (let.Equals('b'))
{
textBox2.Text="B";
cou++;
}
else if (let.Equals('a'))
{
textBox3.Text="A";
cou++;
}
else if (let.Equals('c'))
{
textBox4.Text="C";
cou++;
}
else if (let.Equals('k'))
{
textBox5.Text="K";
cou++;
}
else if (let.Equals('t'))
{
textBox6.Text="T";
textBox8.Text="T";
textBox13.Text="T";
cou=cou+3;
}
else if (let.Equals('o'))
{
textBox7.Text="O";
cou++;
}
else if (let.Equals('h'))
{
textBox9.Text="H";
cou++;
}
else if (let.Equals('e'))
{
textBox10.Text="E";
textBox16.Text="E";
cou=cou+2;
}
else if (let.Equals('f'))
{
textBox11.Text="F";
cou++;
}
else if (let.Equals('u'))
{
textBox12.Text="U";
textBox14.Text="U";
cou=cou+2;
}
else if (let.Equals('r'))
{
textBox15.Text="R";
cou++;
}
else
{
cou=1;
for (int i = 0; i < 26; i++)
{
if (let.Equals(globalvar.arr[i]))
{
globalvar.arr[i] = ' ';
}
}
MessageBox.Show("Incorrect");
}
globalvar.scores[globalvar.k] = globalvar.scores[globalvar.k] +( cou*rand[num - 1]);
globalvar.k = (globalvar.k + 1) % 3;
textBox17.Text = "$" + globalvar.scores[globalvar.k].ToString();
fun();
}
else if (num == 9)
{
globalvar.scores[globalvar.k] = globalvar.scores[globalvar.k] - 1000;
globalvar.k = (globalvar.k + 1) % 3;
textBox17.Text = "$" + globalvar.scores[globalvar.k].ToString();
fun();
}
else if (num == 10)
{
globalvar.k = (globalvar.k + 1) % 3;
fun();
}
}
else if (globalvar.k == 1)
{
int num = r1.Next(1, 11);
if (num < 9)
{
MessageBox.Show("Value is :$", rand[num - 1].ToString());
p.Show();
char let = Prompt.c;
int cou = 0;
if (let.Equals('b'))
{
textBox2.Text = "B";
cou++;
globalvar.arr[1] = ' ';
}
else if (let.Equals('a'))
{
textBox3.Text = "A";
cou++;
globalvar.arr[0] = ' ';
}
else if (let.Equals('c'))
{
textBox4.Text = "C";
cou++;
globalvar.arr[2] = ' ';
}
else if (let.Equals('k'))
{
textBox5.Text = "K";
cou++;
globalvar.arr[13] = ' ';
}
else if (let.Equals('t'))
{
textBox6.Text = "T";
textBox8.Text = "T";
textBox13.Text = "T";
cou = cou + 3;
globalvar.arr[19] = ' ';
}
else if (let.Equals('o'))
{
textBox7.Text = "O";
cou++;
globalvar.arr[14] = ' ';
}
else if (let.Equals('h'))
{
textBox9.Text = "H";
cou++;
globalvar.arr[7] = ' ';
}
else if (let.Equals('e'))
{
textBox10.Text = "E";
textBox16.Text = "E";
cou = cou + 2;
globalvar.arr[4] = ' ';
}
else if (let.Equals('f'))
{
textBox11.Text = "F";
cou++;
}
else if (let.Equals('u'))
{
textBox12.Text = "U";
textBox14.Text = "U";
cou = cou + 2;
globalvar.arr[5] = ' ';
}
else if (let.Equals('r'))
{
textBox15.Text = "R";
cou++;
globalvar.arr[17] = ' ';
}
else
{
cou = 1;
MessageBox.Show("Incorrect");
}
globalvar.scores[globalvar.k] = globalvar.scores[globalvar.k] + (cou * rand[num - 1]);
globalvar.k = (globalvar.k + 1) % 3;
textBox18.Text = "$" + globalvar.scores[globalvar.k].ToString();
fun();
}
else if (num == 9)
{
globalvar.scores[globalvar.k] = globalvar.scores[globalvar.k] - 1000;
globalvar.k = (globalvar.k + 1) % 3;
textBox18.Text = "$" + globalvar.scores[globalvar.k].ToString();
fun();
}
else if (num == 10)
{
globalvar.k = (globalvar.k + 1) % 3;
fun();
}
}
else
{
int num = r1.Next(1, 11);
if (num < 9)
{
MessageBox.Show("Value is :$"+ rand[num - 1].ToString());
p.Show();
char let = Prompt.c;
int cou = 0;
if (let.Equals('b'))
{
textBox2.Text = "B";
cou++;
globalvar.arr[1] = ' ';
}
else if (let.Equals('a'))
{
textBox3.Text = "A";
cou++;
globalvar.arr[0] = ' ';
}
else if (let.Equals('c'))
{
textBox4.Text = "C";
cou++;
globalvar.arr[2] = ' ';
}
else if (let.Equals('k'))
{
textBox5.Text = "K";
cou++;
globalvar.arr[13] = ' ';
}
else if (let.Equals('t'))
{
textBox6.Text = "T";
textBox8.Text = "T";
textBox13.Text = "T";
cou = cou + 3;
globalvar.arr[19] = ' ';
}
else if (let.Equals('o'))
{
textBox7.Text = "O";
cou++;
globalvar.arr[14] = ' ';
}
else if (let.Equals('h'))
{
textBox9.Text = "H";
cou++;
globalvar.arr[7] = ' ';
}
else if (let.Equals('e'))
{
textBox10.Text = "E";
textBox16.Text = "E";
cou = cou + 2;
globalvar.arr[4] = ' ';
}
else if (let.Equals('f'))
{
textBox11.Text = "F";
cou++;
}
else if (let.Equals('u'))
{
textBox12.Text = "U";
textBox14.Text = "U";
cou = cou + 2;
globalvar.arr[5] = ' ';
}
else if (let.Equals('r'))
{
textBox15.Text = "R";
cou++;
globalvar.arr[17] = ' ';
}
else
{
cou = 1;
MessageBox.Show("Incorrect");
}
globalvar.scores[globalvar.k] = globalvar.scores[globalvar.k] + (cou * rand[num - 1]);
globalvar.k = (globalvar.k + 1) % 3;
textBox19.Text = "$" + globalvar.scores[globalvar.k].ToString();
fun();
}
else if (num == 9)
{
globalvar.scores[globalvar.k] = globalvar.scores[globalvar.k] - 1000;
globalvar.k = (globalvar.k + 1) % 3;
textBox19.Text = "$" + globalvar.scores[globalvar.k].ToString();
fun();
}
else if (num == 10)
{
globalvar.k = (globalvar.k + 1) % 3;
fun();
}
}
}
public static string s = "";
Form2 second = new Form2();
private void button2_Click(object sender, EventArgs e)
{
Console.WriteLine("Enter the guess");
string gue = Console.ReadLine().ToLower();
if (gue.Equals("back to the future"))
{
s = "Player " + (globalvar.k + 1) + "won and score is " + globalvar.scores[globalvar.k];
second.Show();
}
}
}
public static class globalvar
{
public static char[] arr = new char[26]{'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
public static int[] scores = new int[3]{0,0,0};
public static int count = 26;
public static int k = 0;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
tb.Text = Form1.s;
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Prompt : Form
{
public static char c;
public Prompt()
{
char[] ch = new char[10];
InitializeComponent();
textboxprom.Text = "abcdef";
label1.Text = "Enter the letter";
string s3 = textboxprom.Text;
ch = s3.ToCharArray(1,3);
c = ch[0];
}
public String TextBox1
{
get
{
return textboxprom.Text;
}
}
Form1 f = new Form1();
private void button1_Click(object sender, EventArgs e)
{
f.Show();
}
private void Prompt_Load(object sender, EventArgs e)
{
}
}
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.