Skip to content

Commit

Permalink
Added installation and build instructions; made shift size 1 to 25 no…
Browse files Browse the repository at this point in the history
…t 1 to 26 in GUI; moved dictionary to be static in a source file and not read in from a text file each time it's needed
  • Loading branch information
taeh98 committed Sep 24, 2020
1 parent 3d968ef commit 78c5035
Show file tree
Hide file tree
Showing 8 changed files with 370,194 additions and 48 deletions.
82 changes: 60 additions & 22 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
[package]
name = "caesar_cipher"
name = "rust_caesar_cipher"
version = "0.0.1"
authors = ["Tom https://github.com/FeynmanTesla"]
authors = ["Tom Hardern - https://github.com/FeynmanTesla"]
edition = "2018"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
rand = "0.7.3"
druid = { git = "https://github.com/linebender/druid.git" }
druid = { git = "https://github.com/linebender/druid.git" }

[profile.release]
opt-level = 3
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Rust-Caesar-Cipher
A Rust program that encodes and decodes text according to Caesar ciphers via a GUI or CLI. It can automatically decode ciphertext whose shift size is unknown.

# Installation and building
It is a prerequisite to have Cargo installed. Install it with rustup (recommended) at https://www.rust-lang.org/tools/install.
With Cargo installed, run "cargo build --release" from the root directory of the repository.
The executable will then be built at target/release/rust_caesar_cipher (from the repository root).
2 changes: 1 addition & 1 deletion src/front_end/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn ui_builder() -> impl Widget<state::AppState> {
let shift_mode_row: Flex<state::AppState> = Flex::row().with_child(Flex::column().with_child(Flex::row().with_child(shift_mode_title_label).with_spacer(20.0)).with_child(Flex::row().with_child(shift_mode_value_label).with_child(change_shift_mode_button).with_spacer(20.0))).with_spacer(20.0);

let shift_size_title_label: Label<state::AppState> = Label::new("Shift size:").with_text_size(20.0);
let shift_size_slider = Slider::new().with_range(1.0, 26.0).lens(state::AppState::shift_size);
let shift_size_slider = Slider::new().with_range(1.0, 25.0).lens(state::AppState::shift_size);
let shift_size_value_label: Label<state::AppState> = Label::new(|state: &state::AppState, _env: &_| format!("{}", state.get_shift_size() as i64)).with_text_size(15.0);
let shift_size_row: Flex<state::AppState> = Flex::row().with_child(Flex::column().with_child(Flex::row().with_child(shift_size_title_label).with_spacer(20.0)).with_child(Flex::row().with_child(shift_size_slider).with_child(shift_size_value_label).with_spacer(20.0))).with_spacer(20.0);

Expand Down
Loading

0 comments on commit 78c5035

Please sign in to comment.