+ 3

Help With The Code Playground Compiler

This code I made for a console game,worked PERFECTLY fin on my pc with gcc BUT it gives alot of errors when I run it here at the code playground,and one of the errors is for unknown type 'bool'..... Idk how this compiler works but wanted to still upload my work.Any help would be appreciated Edit: I managed the bool error by using "_Bool"(which seemed completely pointless) but still the other errors are there.... Edit 2: I worked out all the errors but wtf it dosen't even wait for input,how am I supposed to input all needed vals without any helping text...Can anyone tell me why this compiler is sooooooooooo crappy? Console Log: ..\Playground\:17:1: error: unknown type name 'bool'; did you mean '_Bool'? bool wonToss,playerBatting,targetSet; ^~~~ _Bool ..\Playground\:22:2: error: unknown type name 'bool' bool out; ^~~~ ..\Playground\: In function 'getRandomRange': ..\Playground\:31:2: warning: implicit declaration of function 'srand'; did you mean 'scanf'? [-Wimplicit-function-declaration] srand(time(0)); ^~~~~ scanf ..\Playground\:31:8: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration] srand(time(0)); ^~~~ ..\Playground\:32:13: warning: implicit declaration of function 'rand'; did you mean 'rewind'? [-Wimplicit-function-declaration] int num = (rand() % (upper - lower) + 1) + lower; ^~~~ rewind ..\Playground\: In function 'checkInput': ..\Playground\:41:2: warning: implicit declaration of function 'exit' [-Wimplicit-function-declaration] exit(1); ^~~~ ..\Playground\:41:2: warning: incompatible implicit declaration of built-in function 'exit' ..\Playground\:41:2: note: include '<stdlib.h>' or provide a declaration of 'exit' ..\Playground\: In function 'Comp_Bowl': ..\Playground\:61:16: error: 'true' undeclared (first use in this function); did you mean 'target'? targetSet = true; ^~~~ target ..\Playground\:61:16: note: each undeclared identifier is reporte

5th Jun 2019, 6:00 PM
Devesh Sharma
Devesh Sharma - avatar
5 Answers
+ 1
please add the code here instead of the error messages, this is really disturbing
5th Jun 2019, 6:30 PM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
+ 1
*AsterisK* The code is really long over 200 lines,but its the only code I've posted on my profile, you can find it easily, its under 'EveOdd'
5th Jun 2019, 7:17 PM
Devesh Sharma
Devesh Sharma - avatar
0
Bennett Post That's strange then,gcc compiles my code with 'bool' pretty nicely and I did fix that error by using '_Bool'
5th Jun 2019, 7:24 PM
Devesh Sharma
Devesh Sharma - avatar
0
it seem to be working fine now
5th Jun 2019, 7:56 PM
āœ³AsterisKāœ³
āœ³AsterisKāœ³ - avatar
0
*AsterisK* It dosent on mine.Its supposed to dynamocally take values,taking input for player's score/num AFTER displaying and calculating the opponent's.But you have to enter it all together in playground.........it dosen't take input,only once when you run it........
6th Jun 2019, 12:04 AM
Devesh Sharma
Devesh Sharma - avatar