makes more sense

This commit is contained in:
Adam 2023-01-26 02:54:42 -05:00
parent 2037ae18e8
commit c4528c3768

View file

@ -2,16 +2,16 @@ import React from 'react';
import './Rotor.css'; import './Rotor.css';
class Rotor extends React.Component { class Rotor extends React.Component {
letter(i) { letter(pos) {
const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' const alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
if (i > 25) { if (pos > 25) {
return alphabet[i - 26] return alphabet[pos - 26]
} }
else if (i < 0) { else if (pos < 0) {
return alphabet[26 + i] return alphabet[26 + pos]
} }
else { else {
return alphabet[i] return alphabet[pos]
} }
} }
render() { render() {