Number Guessing Game Project with C Programming and Flowgorithm

Number Guessing Game Project with C Programming and Flowgorithm
เขียนโปรแกรมทายตัวเลข




1. Number Guessing Game Project Source Code on C Programming with Dev C++ IDE
Name Guessing Game Source Code

#include <stdio.h>
int main() {
    srand(time(0));   //Seed random number generator
    int secret, guess;
    guess = 0;
    secret = rand() % 100 + 1; //(0-99)+1 --> 1 - 100;
    //secret = 50+(rand() % (201-50)); --> 50 - 200 
    printf("Guess Number 1 to 100\n"); 
    while (guess != secret) {
        scanf("%d", &guess);
        if (guess == secret) {
            printf("Your guess = %d is Correct!\n", guess);
        } 
		else if (guess > secret)
		{
            printf("Your guess = %d is too High\n", guess);
        }
        else
        {
        	printf("Your guess = %d is too Low\n", guess);
		}
    }
    printf("You're the Winner!\n");
    printf("Thanks for playing!\n");
    return 0;
} 




Figure 1 Name Guessing Game on Dev C++ IDE

Output

Figure 2 Name Guessing Game Output




2. Name Guessing Game Project with Flowgorithm
Download Flowgorithm Software –> http://www.flowgorithm.org/download/index.html
Open Flowgorithm –> Creating Name Guessing Game

Figure 3 Number Guessing Game Project with Flowgorithm

3. Set Code & Console View and Show Variable Watch

Figure 4 Code & Console View




4. Test Number Guessing Game

Figure 5 Number Guessing Game Output

5. Converting Source Code 28 Programming Languages on Flowgorithm

Figure 6 28 Programming Languages for Converting on Flowgorithm

6. Number Guessing Game with Python Programming

Figure 7 Number Guessing Game with Python Programming




7. Number Guessing Game with C++ Programming

Figure 8 Number Guessing Game with C++ Programming

8. Number Guessing Game with Java Programming

Figure 9 Number Guessing Game with Java Programming




9. Number Guessing Game with JavaScript Programming

Figure 10 Number Guessing Game with JavaScript Programming

10. Number Guessing Game with MATLAB Programming

Figure 11 Number Guessing Game with MATLAB Programming




at GlurGeek.Com
Lecturer, Blogger, Traveler, and Software Developer ที่ชอบอ่านบทความใหม่ๆ ตลอดเวลา ชอบหาวิธีสร้าง Inspiration เป็นชีวิตจิตใจ มีความฝันอยากทำ CREATIVE PRODUCT ที่สามารถเปลี่ยนแปลงโลกให้ดีขึ้น และอยากถ่ายรูปสถานที่ท่องเที่ยวรอบโลก สอนหนังสือ ชอบแลกเปลี่ยนความรู้ และเขียน WEBSITE, MOBILE APP, GAME, ETC ที่เป็นประโยชน์กับโลกใบนี้

Leave a Reply

© 2022 GlurGeek.Com
Exit mobile version