Giter VIP home page Giter VIP logo

tr-go-cli's Introduction

TR-GO-CLI

Go alternative for https://codingchallenges.substack.com/p/coding-challenge-43-tr

Step 1

In this step your goal is to support translating from one character to another, when reading from the standard input. For this your program should start up and wait for a line of input from the user. It will then output the line having made the substitution specified, for example:

% cctr c C
coding challenges
Coding Challenges

Type CTRL-D to send the EOF and terminate cctr.

Try it with the following

go build && echo coding challenges | ./cctr c C

Step 2

In this step your goal is to support translation of a range of characters. As is common ranges are specified by the start and end separated by a hyphen. For example the upper case letters are A-Z and the lower case letters a-z. When you’ve implemented this it should look something like this:

% head -n3 test.txt
The Project Gutenberg eBook of The Art of War
    
This ebook is for the use of anyone anywhere in the United States and
 
% head -n3 test.txt | cctr A-Z a-z
the project gutenberg ebook of the art of war
    
this ebook is for the use of anyone anywhere in the united states and

Where we can see the first three lines as published by Project Gutenberg, then the same translated to lowercase in the second example.

Try it with the following

go build && head -n3 test.txt | ./cctr A-Z a-z

tr-go-cli's People

Contributors

pablosanchi 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.