Coder Social home page Coder Social logo

game-encryption's Introduction

Game Code Encryption

Spectacularly well-written plotline

Brooks is the lead programmer of Fallout 5, gets word that an evil malicious hacker named "Crsn" is attempting to steal all the data and shut down all their servers. Brooks calls up his friend, Tristan, a top hacker who happens to be a lead programmer of Persona 6 to encrypt his data.

Your Mission

Help Brooks and Tristan write a program to encrypt the valuable Fallout 5 files and protect them from Crsn. Write a function called changeChar, which will take in three parameters. The first parameter will be a line of text. The second parameter is a letter found in the line of text to be replaced. The third parameter is a letter to replace the value of the second parameter. changeChar replaces all instances of a given letter with another letter in a line of text recursively. (Do not use loops.)

Parameters

lineOfText - the line of text which need certain letters to replace.

charA - the character you want to be replaced.

charB - the character you want charA to be replaced with.

Return Value

The function returns a single string, lineOfText with all instances of charA replaced with charB

Example function call

changeChar('The Jr DevLeague Academy is awesome!!', 'e', 'o') will return "Tho Jr DovLoaguo Acadomy is awosomo!!"

Important Hints

  • Strings have indices too, not just lists
  • You can slice both strings and lists, and a quick way of slicing to either end of a list/string is only having the colon:
    • If you want to slice to the end of the list, instead of [5:len(list)] you can use [5:]
    • If you want slice to the beginning of the list, instead of [0:5], you can use [:5]

game-encryption's People

Contributors

nat-nat33 avatar

Watchers

James Cloos avatar Jason Sewell avatar Jon Tan avatar  avatar Christie Reindle avatar John Headland 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.