Ruby Algorithm — valid ISBN10

  • If the index of the number is equal to 9 (as it will be the last one) and is the digit is “X” to make the assignment to the number variable the value of 10.
  • If the digit is any other number to assign the output with a false value. Otherwise to add to the total variable the number, converted to an integer and multiplied by its index + 1.

Conclusion

--

--

--

Full Stack Web Developer | antonzaharia.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

JPA — How To Store java.time.YearMonth As Integer Or Date Via Hibernate Types Library

How to make your tests fail when they try to access the network (Python)

Go Commands — Part 1

I’ve Uninstalled the Medium Android App

Generating Voxel Planet using 3D Simplex Noise

My Passport For Mac Ntfs

Passport

Guess What Happens When You Combine Your Passions?

ImmuneBytes Completes USTX Smart Contract Audit |2022| Read Details

ImmuneBytes Completes USTX Smart Contract Audit

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Zaharia Anton

Zaharia Anton

Full Stack Web Developer | antonzaharia.com

More from Medium

Construyendo una API RESTfull JSON con Rails 6 [1ra Parte]

Array Algorithm: Rotate an image

Learning Proper RESTful Design By Looking At Rails Generators

Understanding time and space complexity with Big O