Skip to content

mitch3lljones/ruby-array-swap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ruby - Function to Swap Array Elements

Table of Contents

Information

This function implements a typical swap function for an array. This is not easily accessible in Ruby (to my knowledge) so I made a function for me but am happy to share it with you! This function is built with Ruby v2.6.5p114. To check your version, run:

ruby -v

Status

At this time, the project is finished.

Instructions

To run these program, Ruby v2.6.3p62 (or a compatible version) will need to be installed. To check the version of ruby you are using, run this command in terminal:

ruby -v

If you do not have ruby installed, follow these instructions. After ruby is installed, you should clone this repository to a place easily accessible to you using this command in terminal:

git clone https://github.com/fussykyloren/ruby-array-swap.git

Your github username and password should be requested. If not, don't worry about it. After the repository is cloned, you will need to change the directory to where the game example is saved. To to use the fibonacci programs, run this command next:

cd [LOCATION_OF_CLONED_REPOSITORY]

Now you can move the ruby file to where you will need to use it! This can be done using this command:

mv [LOCATION_OF_CLONED_REPOSITORY]/swap.rb [LOCATION_TO_MOVE_FILE]

Or if you'd prefer, you can copy the file using this command:

cp [LOCATION_OF_CLONED_REPOSITORY]/swap.rb [LOCATION_TO_MOVE_FILE]

Releases

No releases published

Packages

No packages published

Languages