Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: TICS Action Run
uses: tiobe/tics-github-action@main
uses: tiobe/tics-github-action@annotations-improvements
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
TICSAUTHTOKEN: 'MmQ0NTRjZmEtZTY0ZC00N2NiLWI0M2YtYzgxOWY2MzEyNGUyOk54LE4vcG9ZKFp7TFlzWg'
Expand Down
16 changes: 8 additions & 8 deletions cpp-game-vs/game.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "game.h"
#include "game.h"

#include <ctime>
#include <iostream>
Expand Down Expand Up @@ -52,12 +52,12 @@ Rule::Choice Rule::GameLogic::operator()(const Rule::Choice lhs, const Rule::Cho
if (lhs == rhs) throw std::domain_error("Do not handle same choice of symbol");

/*
* • Fist equals rock
* • Open hand equals paper
* • Showing the index and middle finger equals scissors.
* • paper beats (wraps) rock
* • rock beats (blunts) scissors
* • scissors beats (cuts) paper.
* • Fist equals rock
* • Open hand equals paper
* • Showing the index and middle finger equals scissors.
* • paper beats (wraps) rock
* • rock beats (blunts) scissors
* • scissors beats (cuts) paper.
*/
std::map<std::tuple<Rule::Choice, Rule::Choice>, Rule::Choice> rule;
rule[std::make_tuple(Rule::Choice::ROCK, Rule::Choice::PAPER)] = Rule::Choice::PAPER;
Expand All @@ -77,7 +77,7 @@ std::unique_ptr<Rule::Choice[]> ComputerResponse::random_actions(size_t number_g
const int number_of_choices = 3;
srand( (unsigned)time( NULL ) );
for (size_t i = 0; i < number_games_tobe_played; ++i) {
p[i] = Global::mapping_choice(rand() % number_of_choices + 1);
p[i] = Global::mapping_choice(rand() % number_of_choices + 1);
}
return p;
}
Expand Down
2 changes: 1 addition & 1 deletion cpp-game-vs/game.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifndef GAME_H
#ifndef GAME_H
#define GAME_H

#include <memory>
Expand Down
6 changes: 2 additions & 4 deletions cpp-game-vs/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <iostream>
#include <iostream>
#include "game.h"

using namespace std;
Expand All @@ -7,12 +7,10 @@ int main()
{
int plays = Global::number_of_play(), counter = 0, player_score = 0, ai_score = 0;
auto ai = ComputerResponse::random_actions(plays);
char t[4] = "C++";
strcpy_s(t, "C++++++");

int* mypointer;

mypointer = NULL;
mypointer = NULL;
*mypointer = 30;

wchar_t w = L'Â';
Expand Down