Microsoft Small Basic

Program Listing: DDG275
GraphicsWindow.Show()
a = Controls.AddMultiLineTextBox(GraphicsWindow.Width/2-100,GraphicsWindow.Height/2-50)
While Text.GetLength(b) <> 1
TextWindow.WriteLine("間違いではない文字を入力してください")
b = TextWindow.Read()
EndWhile
b = Text.GetCharacterCode(b)
c = 0
WN = 0
For i=1 To Text.GetLength(Controls.GetTextBoxText(a))
If Text.GetCharacterCode(Text.GetSubText(Controls.GetTextBoxText(a),i,1)) <> "13" And Text.GetCharacterCode(Text.GetSubText(Controls.GetTextBoxText(a),i,1)) <> "10" Then
If Text.GetCharacterCode(Text.GetSubText(Controls.GetTextBoxText(a),i,1)) <> b Then
TextWindow.WriteLine(Text.GetSubText(Controls.GetTextBoxText(a),i,1)+"("+(i-c)+"文字目)")
WN = WN+1
wrong[WN] = i-c
wronI[WN] = i
EndIf
Else
c=c+1
EndIf
EndFor

For i=1 To WN
Controls.SetTextBoxText(a,Text.GetSubText(Controls.GetTextBoxText(a),1,wronI[i])+"←"+Text.GetSubTextToEnd(Controls.GetTextBoxText(a),wronI[i]+1))
For Second=i To WN
wronI[Second]=wronI[Second]+1
EndFor
EndFor