Simple 'Piece Moving' Puzzle
This game simulates a simple "piece movable" puzzle, corresponding to an Image cuted in pieces which are painted in several PictureBox's. Then, the player must move the pieces, putting them in their right positions, making the puzzle complete! it also shows you how to freely move controls on a form at Run-Time WITHOUT ANY API FUNTIONS!
AI
สรุปโดย AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
ซอร์สโค้ด
Upload
'Add a richtextbox control in ur form<br<br>
<p>Dim sel1, sel2 as Integer <br>
<br>
Sub Richtextbox1_MouseDown(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles Richtextbox1.MouseDown<br>
If Richtextbox1.SelectedText <> "" And e.Clicks <> 2 Then<br>
sel1 = Richtextbox1.SelectionStart<br>
sel2 = Richtextbox1.SelectionLength<br>
Richtextbox1.DoDragDrop(Richtextbox1.SelectedRtf, DragDropEffects.Move)<br>
End If<br>
End Sub<br>
<br>
<br>
Private Sub Richtextbox1_DragEnter(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles Richtextbox1.DragEnter<br>
e.Effect = DragDropEffects.Move<br>
End Sub<br>
<br>
Private Sub Richtextbox1_DragDrop(ByVal sender As Object, ByVal e As
System.Windows.Forms.DragEventArgs) Handles Richtextbox1.DragDrop<br>
If Richtextbox1.SelectionStart < sel1 Then<br>
Dim selStart As Int16 = Richtextbox1.SelectionStart<br>
Richtextbox1.SelectedRtf = e.Data.GetData(DataFormats.Text).ToString()<br>
Richtextbox1.SelectionStart = sel1 + sel2<br>
Richtextbox1.SelectionLength = sel2<br>
Richtextbox1.SelectedText = ""<br>
Richtextbox1.SelectionStart = selStart<br>
End If<br>
If Richtextbox1.SelectionStart > sel1 + sel2 Then<br>
Richtextbox1.SelectedRtf = e.Data.GetData(DataFormats.Text).ToString()<br>
Richtextbox1.SelectionStart = sel1<br>
Richtextbox1.SelectionLength = sel2<br>
Richtextbox1.SelectedText = ""<br>
End If<br>
End Sub</p>
<br><br>
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br>
RichTextBox1.AllowDrop = True<br>
End Sub
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
void main(){
int numin;
int numbers;
int temp[100];
int numbers2;
int temp2;
cout << "How many numbers do you want to sort? ";
cin >> numin;
cout << "\nOk, so you want to sort " << numin << " numbers.\n Go ahead and start inputting them ";
numbers = 1;
for(numbers = 1; numbers < numin + 1; numbers++){
cout << "\nEnter number " << numbers << "\n";
cin >> temp[numbers];
cout << "\n";
}
// Sorting happens here******************************************************************************
for(numbers = 1; numbers < numin + 1; numbers++){
for(numbers2 = numbers+1; numbers2 < numin + 1; numbers2++){
if(temp[numbers] > temp[numbers2]){
temp2 = temp[numbers];
temp[numbers] = temp[numbers2];
temp[numbers2] = temp2;
}
}
}
////sorting ends here (betweent the for loops
for(numbers = 1; numbers < numin + 1; numbers++){
cout << temp[numbers] << "\n";
}
}
ความคิดเห็นดั้งเดิม (3)
กู้คืนจาก Wayback Machine