Advertisement
2002VB Complete Applications #18117

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.

மூலக் குறியீடு
original-source
Upload
#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) மீட்டெடுக்கப்பட்டது