+ 5

how can i make tic tac toe (x-o-x) game without using functions in c language?

C

4th Dec 2021, 9:12 PM
Muhammet
38 Antworten
+ 3
It sounds like your professor is trying to get you all to understand the scope of variables and loops. You can build a tic tac.toe without a self defined function, you will still have to use main however. Use a for loop which sets the variable to check for a win Set your array array of nine to zero Accept input with all your error checks Check for win or tie Break out of loop
6th Dec 2021, 12:48 PM
William Owens
William Owens - avatar
+ 8
What do you mean by "functions"? Do you mean, you don't want to write own functions? May I ask why you don't want to use functions?
4th Dec 2021, 9:28 PM
Lisa
Lisa - avatar
+ 3
Have you tried? Let us see your attempt
4th Dec 2021, 9:58 PM
Paul K Sadler
Paul K Sadler - avatar
+ 3
Sololearn has a C course. Maybe youbwoyld like to practice basics ny doing the course and then come back here when you have started your code?
4th Dec 2021, 10:08 PM
Lisa
Lisa - avatar
+ 2
Still, what is "without using functions"?
4th Dec 2021, 9:34 PM
Lisa
Lisa - avatar
+ 2
I don't know C but know that you clarified your question, others can help you.
4th Dec 2021, 9:43 PM
Lisa
Lisa - avatar
+ 2
Muhammet if you go into the Sololearn Code section and search for tic, you'll find about 45 implementations in C to inspire you.
4th Dec 2021, 10:26 PM
Brian
Brian - avatar
+ 2
C language is easy
6th Dec 2021, 1:03 AM
Shubham Bhatia
Shubham Bhatia - avatar
+ 1
No function will be used, for example only printf scanf if else switch case while do etc etc these can be used but the function will not be used
4th Dec 2021, 9:37 PM
Muhammet
+ 1
Yes, I don't know Turkish, sorry. But if you can put your attempt in a code-bit in the sololearn playground we can work on it there.
4th Dec 2021, 10:09 PM
Paul K Sadler
Paul K Sadler - avatar
+ 1
I just downloaded the application, I couldn't find the game part Paul K Sadler
4th Dec 2021, 10:16 PM
Muhammet
+ 1
Your teacher doesn't want you to use functions because they want to see how you implemented your work. Basically, implement your solution without abstraction.
4th Dec 2021, 10:25 PM
Chaos EMC2
Chaos EMC2 - avatar
+ 1
Kusura bakma biraz sert çıkmışım, burası genelde olan bir koda destek vermek için kullanılıyor. Yani kimse sıfırdan kod yazıp eline vermez.
5th Dec 2021, 11:59 AM
Emre İRİŞ
Emre İRİŞ - avatar
+ 1
C is easy... Why!!! If you don't want use C language Use another like python ....
5th Dec 2021, 9:51 PM
Mahmoud Elsayed
Mahmoud Elsayed - avatar
+ 1
A C program usually at least has the main function as an entry point to the program. There are certain exceptions though. You can look here on this link https://stackoverflow.com/q/7050925 I just did a simple Google search btw
6th Dec 2021, 5:04 AM
Macross-Plus
Macross-Plus - avatar
+ 1
With your permission, I want to learn programming
6th Dec 2021, 5:27 PM
Mahmoud Els
Mahmoud Els - avatar
0
This is a project assignment, my teacher asked for it.
4th Dec 2021, 9:33 PM
Muhammet
0
Can you help me?
4th Dec 2021, 9:38 PM
Muhammet
0
If you have someone you can direct me to, I would appreciate it if you could contact me privately.
4th Dec 2021, 9:46 PM
Muhammet
0
You could us a while or do while loop taking input while there are still boxes to put x's and o's and no one has won the game. Once no boxes are left or someone has won you would end the loop and the game.
4th Dec 2021, 9:51 PM
Paul K Sadler
Paul K Sadler - avatar