Giter Site home page Giter Site logo

js-to-csharp's Introduction

From C# to JavaScript and Back

This repository contains a collection of C# and JavaScript programs. Each program creates some data, performs some logic and prints results to the console.

C# programs are executed in the terminal using the dotnet run command. JavaScript programs are served with a web server (e.g. http-server or serve) and executed in the browser.

Your Task

For each program you are provided with either the C# or the JavaScript implementation. Your task is to read the code that is provided and translate it from one language into the other. When given a program written in C#, you should write a JavaScript program that has the same behavior. And, when given a JavaScript program, you should write a C# program.

The individual exercises are organized by folder (see links below). Each exercise folder contains a README.md and both csharp and js folders. For C# to JavaScript translations, start in the csharp folder and write your new code in the js folder. For JavaScript to C# translations go the opposite direction.

NOTE: It is very important to remember that while there are many language similarities between C# and JavaScript, this is NOT a line-for-line translation. In many cases the C# code will look markedly different from the JavaScript code. The goal is for each implementation to have the same behavior not the same code.

NOTE: It will be easiest to have multiple instances of VS Code open while working on these exercises. For example when working on the place-names exercise you should open VS Code from within each of these directories:

  • translate-csharp-js/place-names/csharp/PlaceNames
  • translate-csharp-js/place-names/js/placeNames

C# to JavaScript

Translate the C# code found in the exercises below into JavaScript code.

  1. Place Names
  2. Enemies List
  3. Rolling Dice
  4. Grimoire

JavaScript to C#

Translate the JavaScript code found in the exercises below into C# code.

  1. Wish List
  2. Insulter
  3. Fizzbuzz
  4. Dinner Party
  5. Word Frequency

NOTE: You will need to create a new project for each program.

cd csharp
dotnet new console -o <New Project Name>

Resources

C# vs JavaScript Cheatsheet

js-to-csharp

js-to-csharp

js-to-csharp's People

Contributors

askingalot avatar shanks-t avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.