, .. , , , . .

 

 

!

 

:

:

 

 

 

?

StudentHelp, , MS Word. , , antiplagiat.ru, etxt.ru advego.ru. StudentHelp , Word .


:


:

: . : 04.06.13. : 2013. : 66. antiplagiat.ru: < 30%

():





...4
..4
..6
酅....7
腅..9
15
20
ⅅ..21
...22
122




. , , . : , . , - , .
, ! . - , : , ! , , . .
. : Quake, .
: , , , , ... Ƞ ! , ... Ƞ, .
- , , : , , .
.
.
.

.
, , .
, , , . - . .   : 300400 ., ... Quake 10000 .
, , . , , 3D-Action .
. 3D-Action . . , , , ... Ƞ .
, , . : 5- . 5 .



, . : .
:
*
*
*
:
*
*
* ( : google.com wordnet.princeton.edu)
C#, Microsoft .NET Framework.
Microsoft .NET Framework , Microsoft, , , web .
C#, , . .NET . .



1950- 1960- . , EDSAC. , 1942 .
:
* : , , ;
* : , ; , , , ;
* : , , . . .
* : ,.

, , , . , , , . ( ) . - , ;
* - ;
* - ;
* - ;
* - ;
* - , ;
* - , .



MyFadeLabel, Label. Ѡ : , , .
MyFadeLabel 1.

.
private void StartGame()
{
Random r = new Random(DateTime.Now.Millisecond);
randomPos1 = r.Next(0, WordLength);
randomPos2 = r.Next(0, WordLength - 1);
if (randomPos2 == randomPos1)
{
randomPos2++;
}
wordIndex = r.Next(0, words.Count);
while (!IsWordMatchForDifficultyLevel(words[wordIndex], gameDifficulty))
{
wordIndex = r.Next(0, words.Count);
}
_currentPuzzleWord = words[wordIndex].Substring(2);
ResetGrid();
initLayout.Controls[randomPos1].Text = CurrentPuzzleWord[randomPos1] + "";
initLayout.Controls[randomPos2].Text = CurrentPuzzleWord[randomPos2] + "";
SetLetterToolTip(initLayout.Controls[randomPos1], true);
SetLetterToolTip(initLayout.Controls[randomPos2], true);
MyFadeLabel fl = initLayout.Controls[randomPos1] as MyFadeLabel;
fl.FadeToForeColor = Color.White;
fl.FadeToBackColor = Color.CornflowerBlue;
fl.Font = bold;
fl.FadeDuration = fl.MaxTransitions;
fl.Fade();
fl = initLayout.Controls[randomPos2] as MyFadeLabel;
fl.FadeToForeColor = Color.White;
fl.FadeToBackColor = Color.CornflowerBlue;
fl.Font = bold;
fl.FadeDuration = fl.MaxTransitions;
fl.Fade();
currentAttempt = GameState.FirstAttempt;
guess.Text = "";
history.Clear();
history.Add(guess.Text);
historyIndex = 1;
solved[randomPos1] = solved[randomPos2] = true;
definitionLink.Visible = false;
bonusScore = MaximumBonusScore;
bonusTimer.Start();
helpGiven = false;
guess.ForeColor = TextBox.DefaultForeColor;
}

Random .
2 .
MyFadeLabel , .
5 .
if (e.KeyChar != (char)Keys.Enter && guess.SelectionLength == 0)
{
return;
}
if (guess.SelectionLength != 0)
{
e.Handled = false;
return;
}
if (!IsValidWord(guess.Text))
{
errorLabel.Visible = true;
guess.SelectAll();
messageLabel.Text = null;
for (int i = 0; i < WordLength; i++)
{
layout.Controls[currentAttempt*WordLength + i].Text = guess.Text[i] +"";
layout.Controls[currentAttempt * WordLength + i].BackColor = Color.Gainsboro;
if (solved[i] && currentAttempt < GameState.LastAttempt)
{
layout.Controls[(currentAttempt+1)*WordLength+i].Text=CurrentPuzzleWord[i]+"";
}
}
currentAttempt++;
return;
}
else
{
errorLabel.Visible = false;
if (history[historyIndex - 1] != guess.Text)
{
history.Add(guess.Text);
historyIndex = history.Count;
}
}
DisplayCorrectLetters();
DisplayProbableLetters();
currentAttempt++;
}

private void DisplayProbableLetters()
{
int labelPosition = 0;
for (int i = 0; i < WordLength; i++)
{
if (marked[i] && guess.Text[i] == CurrentPuzzleWord[i])
{
continue;
}
for (int j = 0; j < WordLength; j++)
{
if (guess.Text[i] == CurrentPuzzleWord[j])
{
if (!marked[j])
{
marked[j] = true;
labelPosition = currentAttempt * WordLength + i;
MyFadeLabel fl = layout.Controls[labelPosition] as MyFadeLabel;
fl.FadeToBackColor = Color.OrangeRed;
fl.FadeToForeColor = Color.WhiteSmoke;
fl.FadeFromForeColor = Label.DefaultBackColor;
fl.FadeFromBackColor = Label.DefaultBackColor;
fl.Fade();
layout.Controls[labelPosition].Font = bold;
SetLetterToolTip(layout.Controls[labelPosition], false);
break;
}
else if (CurrentPuzzleWord.Substring(j + 1).IndexOf(guess.Text[i]) >= 0)
{
continue;
}
else
break;
}
}
}
}

private void DisplayCorrectLetters()
{
int labelPosition = 0;
lock (solved)
{
for (int i = 0; i < WordLength; i++)
{
labelPosition = currentAttempt * WordLength + i;
layout.Controls[labelPosition].Text = guess.Text[i] + "";
if (guess.Text[i] == CurrentPuzzleWord[i])
{
solved[i] = true;
MyFadeLabel fl = layout.Controls[labelPosition] as MyFadeLabel;
fl.FadeFromForeColor = Label.DefaultBackColor;
fl.FadeFromBackColor = Label.DefaultBackColor;
fl.FadeToBackColor = Color.GreenYellow;
fl.FadeFromForeColor = Label.DefaultForeColor;
fl.Fade();
layout.Controls[labelPosition].Font = bold;
SetLetterToolTip(layout.Controls[labelPosition], true);
}
if (currentAttempt < GameState.LastAttempt && solved[i])
{
layout.Controls[labelPosition + WordLength].Text = CurrentPuzzleWord[i] + "";
SetLetterToolTip(layout.Controls[labelPosition + WordLength], true);
}
marked[i] = (guess.Text[i] == CurrentPuzzleWord[i]);
}
}
}

, .
, , , , . , (DisplayCorrectLetters()). , 蠖 (DisplayProblableLetters()). .

if (guess.Text == CurrentPuzzleWord)
{
guess.Text = "Correct!";
for (int i = 0; i < WordLength && currentAttempt < GameState.MaximumAttemptsOver; i++)
{
layout.Controls[currentAttempt * WordLength + i].Text = "";
}
definitionLink.Text = "What's " + CurrentPuzzleWord + "?";
definitionLink.Visible = true;
UpdateScore();
currentAttempt = GameState.ViewingWord;
helpLetterTimer.Stop();
return;
}

, , .

:

private void UpdateScore()
{
score += (GameState.MaximumAttemptsOver - currentAttempt + 1) * 100 + bonusScore;
scoreLabel.Text = string.Format("{0:#,###,###}", score);
bonusTimer.Stop();
messageLabel.Text = null;
}

:

1.


Enter.

:

:

, . , , . 堖 . -, .

Escape , Your guess . .

:
* easy, medium hard
*
*

About :

.

:

Whats while - :



.  , . :
:
*
*
*
*
*
* ( : google.com wordnet.princeton.edu)


:
. . # Ƞ .NET. .
.. #
http://www.esate.ru/page/uroki-OpenGL-c-sharp/


1 ()
MyFadeLabel.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace word_guess
{
/// <summary>
/// A label that supports fading transition
/// between specified back and fore colors
/// </summary>
public class MyFadeLabel : Label
{
private Color _fadeFromBackColor = DefaultBackColor;
/// <summary>
/// The back color from which to start fading from
/// </summary>
public Color FadeFromBackColor
{
get { return _fadeFromBackColor; }
set
{
_fadeFromBackColor = value;
BackColor = value;
}
}

private Color _fadeFromForeColor = DefaultForeColor;
/// <summary>
/// The fore color from which to start fading from
/// </summary>
public Color FadeFromForeColor
{
get { return _fadeFromForeColor; }
set
{
_fadeFromForeColor = value;
ForeColor = value;
}
}

private Color _fadeToForeColor = DefaultForeColor;
/// <summary>
/// The fore color to which the label
/// should fade to
/// </summary>
public Color FadeToForeColor
{
get { return _fadeToForeColor; }
set
{
_fadeToForeColor = value;
}
}

private Color _fadeToBackColor = DefaultBackColor;
/// <summary>
/// The back color to which the label
/// should fade to
/// </summary>
public Color FadeToBackColor
{
get { return _fadeToBackColor; }
set
{
_fadeToBackColor = value;
}
}

private int _fadeDuration = 2000;
/// <summary>
/// The duration over which the fade
/// effect has to happen
/// </summary>
public int FadeDuration
{
get { return _fadeDuration; }
set
{
_fadeDuration = value;
}
}

private int _maxTransitions = 64;
/// <summary>
/// The number of transitions that make up
/// the fade effect
/// </summary>
public int MaxTransitions
{
get { return _maxTransitions; }
set
{
_maxTransitions = value;
}
}

/// <summary>
/// The interval for the timer
/// </summary>
private int FadeTimerInterval
{
get
{
int interval = (int)((float)FadeDuration / (float)MaxTransitions);
return interval == 0 ? 1 : interval;
}
}

private Timer FadeTimer = new Timer();
private int CurrentTransition = 0;
private delegate void PerformActivityCallback();
private Color[] BackColorMap;
private Color[] ForeColorMap;

public MyFadeLabel()
: base()
{
FadeFromBackColor = Label.DefaultBackColor;
ForeColor = Label.DefaultBackColor;
FadeTimer.Tick += new EventHandler(fadeTimer_Tick);
}

/// <summary>
/// Handles the fade timer tick
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
void fadeTimer_Tick(object sender, EventArgs e)
{
if (this.InvokeRequired)
{
PerformActivityCallback d = new PerformActivityCallback(FadeControl);
this.Invoke(d);
}
else
{
FadeControl();
}
}

/// <summary>
/// Fades the control
/// </summary>
private void FadeControl()
{
BackColor = BackColorMap[CurrentTransition];
ForeColor = ForeColorMap[CurrentTransition];
CurrentTransition++;

// If we are done with the transition
// stop the timer
if (CurrentTransition == MaxTransitions)
{
FadeTimer.Stop();
}
}

/// <summary>
/// Fades the control between
/// the fade from and fade to colors specified
/// </summary>
public void Fade()
{
CreateColorMaps();
CurrentTransition = 0;
FadeTimer.Interval = FadeTimerInterval;
FadeTimer.Start();
}

/// <summary>
/// Stops the fading
/// </summary>
public void StopFading()
{
FadeTimer.Stop();
}

/// <summary>
/// Resets the back and fore colors to their
/// respective fade from colors
/// </summary>
public void Reset()
{
ForeColor = FadeFromForeColor;
BackColor = FadeFromBackColor;
}

/// <summary>
/// Computes the color maps required during fade
/// transition
/// </summary>
private void CreateColorMaps()
{
float aDelta, rDelta, gDelta, bDelta;
int a, r, g, b;
BackColorMap = new Color[MaxTransitions];
ForeColorMap = new Color[MaxTransitions];

// Create the color maps for the back color
aDelta = (FadeToBackColor.A - FadeFromBackColor.A) / (float)MaxTransitions;
rDelta = (FadeToBackColor.R - FadeFromBackColor.R) / (float)MaxTransitions;
gDelta = (FadeToBackColor.G - FadeFromBackColor.G) / (float)MaxTransitions;
bDelta = (FadeToBackColor.B - FadeFromBackColor.B) / (float)MaxTransitions;

BackColorMap[0] = FadeFromBackColor;
for (int i = 1; i < MaxTransitions; i++)
{
a = (int)(BackColorMap[i - 1].A + aDelta);
r = (int)(BackColorMap[i - 1].R + rDelta);
g = (int)(BackColorMap[i - 1].G + gDelta);
b = (int)(BackColorMap[i - 1].B + bDelta);

if (a < 0 || a > 255) a = FadeToBackColor.A;
if (r < 0 || r > 255) r = FadeToBackColor.R;
if (g < 0 || g > 255) g = FadeToBackColor.G;
if (b < 0 || b > 255) b = FadeToBackColor.B;

BackColorMap[i] = Color.FromArgb(a, r, g, b);
}

// Create the color maps for the fore color
aDelta = (FadeToForeColor.A - FadeFromForeColor.A) / (float)MaxTransitions;
rDelta = (FadeToForeColor.R - FadeFromForeColor.R) / (float)MaxTransitions;
gDelta = (FadeToForeColor.G - FadeFromForeColor.G) / (float)MaxTransitions;
bDelta = (FadeToForeColor.B - FadeFromForeColor.B) / (float)MaxTransitions;
ForeColorMap[0] = FadeFromForeColor;
for (int i = 1; i < MaxTransitions; i++)
{
a = (int)(ForeColorMap[i - 1].A + aDelta);
r = (int)(ForeColorMap[i - 1].R + rDelta);
g = (int)(ForeColorMap[i - 1].G + gDelta);
b = (int)(ForeColorMap[i - 1].B + bDelta);

if (a < 0 || a > 255) a = FadeToForeColor.A;
if (r < 0 || r > 255) r = FadeToForeColor.R;
if (g < 0 || g > 255) g = FadeToForeColor.G;
if (b < 0 || b > 255) b = FadeToForeColor.B;

ForeColorMap[i] = Color.FromArgb(a, r, g, b);
}
}
}
}

Guess.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Data;
using System.Drawing;
using System.Text;
using System.IO;
using System.Threading;
using System.Windows.Forms;
using System.Reflection;
using System.Runtime.InteropServices;
using System.Timers;

namespace word_guess
{
/// <summary>
/// The word guess game form
/// </summary>
public partial class WordGuess : Form
{

#region Properties and fields

#region Word list related
/// <summary>
/// The index of the word to guess
/// </summary>
private int wordIndex;

/// <summary>
/// The list of words in the puzzle
/// </summary>
private List<string> words = new List<string>();
#endregion

#region History related
/// <summary>
/// The index of the last word added to the hisory list
/// </summary>
private int historyIndex;

/// <summary>
/// The list of words attempted in a game
/// </summary>
private List<string> history = new List<string>();
#endregion

#region UI related
private Font bold = new Font("Georgia", 12F, FontStyle.Bold);
private Font regular = new Font("Georgia", 12F, FontStyle.Regular);
#endregion

#region Scoring related
/// <summary>
/// The user's score
/// </summary>
int score;

/// <summary>
/// The timer for the bonus score
/// </summary>
System.Timers.Timer bonusTimer = new System.Timers.Timer();

/// <summary>
/// The bonus score available
/// </summary>
int bonusScore;

/// <summary>
/// Delegate to enable displaying the bonus score
/// in a thread safe manner
/// </summary>
delegate void PerformActivityCallback();

/// <summary>
/// The maximum possible bonus at a time
/// </summary>
const int MaximumBonusScore = 1000;

/// <summary>
/// The bonus timer interval
/// </summary>
const int BonusTimerInterval = 100;

/// <summary>
/// A color map
/// </summary>
Color[] ColorMap = new Color[100];

/// <summary>
/// Color map index factor used to set
/// the color of the score
/// </summary>
float ColorMapIndexFactor = 0.1F;

#endregion

#region Letter processing related

/// <summary>
/// The length of a word
/// </summary>
private const int WordLength = 5;

/// <summary>
/// Holds which all letters have been solved so far
/// </summary>
private bool[] solved = new bool[WordLength];

/// <summary>
/// Indicates whether a letter has been accounted for
/// while highlighting letters in the guess that are not
/// in the correct position
/// </summary>
private bool[] marked = new bool[WordLength];
#endregion

#region Game state related

/// <summary>
/// The state of the current attempt
/// </summary>
public int currentAttempt;

static class GameState
{
/// <summary>
/// Indicates the last attempt at solving a word
/// </summary>
public const int LastAttempt = 4;

/// <summary>
/// Indicates the first attempt at solving a word
/// </summary>
public const int FirstAttempt = 0;

/// <summary>
/// The maximum number of attempts
/// </summary>
public const int MaximumAttemptsOver = 5;

/// <summary>
/// Indicates the original or solved word is displayed
/// </summary>
public const int ViewingWord = 6;

/// <summary>
/// The game is diplaying the initial screen
/// </summary>
public const int InitialDisplay = -1;
}

#endregion

#region Game difficulty related
/// <summary>
/// The difficulty levels of the game
/// </summary>
enum DifficultyLevel
{
Easy,
Medium,
Hard
}

/// <summary>
/// The current game difficulty level
/// </summary>
private DifficultyLevel gameDifficulty = DifficultyLevel.Easy;

private const string EasyWordPrefix = "e:";
private const string MediumWordPrefix = "m:";
private const string HardWordPrefix = "h:";

/// <summary>
/// The help timer waits to and checks if you
/// are having difficulty with a word. It provides
/// an extra letter for your conveni
..................



90% antiplagiat.ru, etxt.ru advego.ru




* . , .