Skip to content

jeuzee/tic-tac-two

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

TIC-TAC-TWO in Console and Web

Introduction

  • Game was written as a course project in TalTech in Autumn 2024

  • Can be played from Console and Web

  • Web is done via Razor Pages

  • It supports custom configs that can be added/edited in both Console and Web UI

  • App supports both JSON and Database ways of storaging users configurations and games.

  • JSON and Database are separate, so swapping from one to another doesn't transfer data between them

  • Game has a relatively smart AI and three different game modes:
    Player vs Player
    Player vs AI
    AI vs AI

  • To swap from JSON to Database or vice versa all that you need to do is comment and uncomment corresponding lines in program.cs file
    For ConsoleApp program.cs:
    var configRepository = new ConfigRepositoryJson();
    var gameRepository = new GameRepositoryJson();
    // var dbContext = new AppDbContextFactory().CreateDbContext([]);
    //
    // var configRepository = new ConfigRepositoryDb(dbContext);
    // var gameRepository = new GameRepositoryDb(dbContext);
    For WebApp program.cs:
    // connectionString = connectionString.Replace("<%location%>", FileHelper.BasePath);
    //
    // builder.Services.AddDbContext<AppDbContext>(options =>
    // options.UseSqlite(connectionString));
    builder.Services.AddScoped<IConfigRepository, ConfigRepositoryJson>();
    builder.Services.AddScoped<IGameRepository, GameRepositoryJson>();
    builder.Services.AddScoped<IUserRepository, UserRepositoryJson>();
    // builder.Services.AddScoped<IConfigRepository, ConfigRepositoryDb>();
    // builder.Services.AddScoped<IGameRepository, GameRepositoryDb>();
    // builder.Services.AddScoped<IUserRepository, UserRepositoryDb>();

About

Tic-tac-two game in console and web

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published