ArtemkaKun / csharptov

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

C# to V // TinyRPG

Introduction

This is a simple project to demonstrate how to convert a C# project to V. It is a tiny command-line RPG game that allows the player to create a character and fight randomly generated enemies on every turn. Gameplay is limited to attacking and defending (counter-attacking), but this project demonstrates a few key features of V:

  1. How to use interfaces, structs and custom functions.
  2. Struct embedding and how it helps code-reuse.
  3. Generating random numbers.

Running the game

For the C# project, you just need to do this in the csharp folder:

dotnet run .

For the V project, the command is similar, which must be run in the v/rpg folder:

v run .

About


Languages

Language:C# 56.2%Language:V 43.8%