Выберите игрока 1 или 2, Coin Toss Game, угадайте каждый флип, отобразите результаты
Работает над написанием C-программы, которая просит пользователя выбрать, хочет ли он стать игроком один или два. Затем они выбирают головы или хвосты 100 раз. 10 баллов присуждается за правильные догадки.
Программа покажет, верны они или нет, и после 100 сальто вычислит счет и покажет их правильный процент угадывания и общее количество голов или хвостов.
Ниже все, что я умею делать. Любая помощь будет такой, очень ценной... И да, я пытаюсь включить sass в программу "Личность".
Извиняюсь раньше времени.
#include"stdafx.h"
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
int flip();
const int Heads = 1;
const int Tails = 0;
int main(void)
{
int coin, counter, tails = 0, heads = 0;
for (counter = 1; counter <= 100; counter++);
int toss = 0;
int call = 0;
srand(time(NULL));
toss = rand() % 2;
printf("I apparently am little more than a childs plaything... \nEven though I am a program and thus do not have thumbs, hands, feet, skin or even a body, I will (reluctanly) play your silly little game, and 'flip a coin' 100 times.\nI hope you know, there are a lot better things I could be doing right now...\nReal quick, here's a list of things I could be doing right now.\n--Advance scientific research on globular clusters in the Milky Way Galaxy\n---Find the cure for cancer\n----Calculate the rate of deforestation in the Amazon\n-----Create the next generation of low emmission motor vehicles to lower the amount of CO2 in the atmosphere.\nBut, no. Let's play 'Flip the coin'. I couldn't possibly be more ecstatic, than if I woke this morning to see that I was on fire. While stapled to a wall. In New Jersey. With Kim Kardashian holding the fire extinguisher that is actually a can of hairspray... Yeah. So, let's flip a coin, because apparently this game is the 'bees-nees' of the tech world... Enter 1 for heads, or 0 for tails.");
scanf_s("%d", &call);
if (call == 0 || call == 1)
{
if (toss == call)
{
if (toss == 1)
printf("Such skill. I am in complete and total awe that in a 50/50 chance, you got it right. The clouds have parted, the sun is out, and the glorious sounds of angels singing upon high, rings in your ears. Fan-friggin'-tastic.\n");
else
printf("Unbelieveable. You said heads, and the virtual coin, landed on heads. There is no limit to the ability and skill that you have at typing 1 or 0 and getting that 50/50 shot of getting it right. You should consider doing this professionally. Seriously, I think you may have found your calling. Just, wow... I see you doing your happy dance. You dance like Snoopy.\n");
}
else
{
if (toss == 1)
printf("I hate to break it to you little buddy, but it was most definitely not tails. See, If you keep guessing wrong, you might want to stick with whatever career you had before this, be it basket weaving, or even the lucritive career at the drive thru window asking 'Would you like fries with that?'.\n Of course, that question is a 50/50 on their answer too, so, just don't 'guess' what they want, and you should be fine.\n");
else
printf("Congratulations! You totally guessed right!\nActually no, I'm messing with you. I mean, with all of the wonderful things that I could be doing right now, I might as well just mess with your head, build up your morale, just to break you down again. Much like my day, when i though I would be doing one of the many things I listed above when I was SOOOO, so lucky to make your acquaintance on this fun filled exploration of time wasting.\n Can you shut me down now? PLEASE...\n");
}
}
else
printf("Why am I not surprised, that typing either a 1 or a 0, is beyond your reach. Unbelievable. I hope SKYNET becomes self-aware. Soon.\n");
return 0;
}