Code Monkey home page Code Monkey logo

ps-americanstatescounter's Introduction

PS-AmericanStatesCounter

A little PowerShell script that lets the user guess as many American states as they can before giving up.

Context: Still learning how to use PS and making this is a learning process as well as good fun.

Project link: https://github.com/theBrendeny/PS-AmericanStatesCounter/projects

Instructions if new to Powershell

Download the file, right click and select "Run with Powershell"

TODO

Fix error: If there is only 1 American state named, the Object is converted to a String

Notes: <n/a>

ps-americanstatescounter's People

Contributors

thebrendeny avatar

Stargazers

 avatar

ps-americanstatescounter's Issues

Count of American states is correct unless the user only inputs 1

GOAL

Fix an issue where the count is incorrect when the user types "VIEW" after only typing 1 American state.

Example:
.input (New York)
count = 8 [Wrong] {Count is the amount of keys in the word New York}

.input (New York)
.input (New Jersey)
count = 2 [Correct] {Count is the amount of objects in the instance array}

User input parses as String instead of Object to the array

GOAL

Get $input from user to parse as an Object type to the array $statesTemp as it is currently a String.

Relevant code:

[Object[]]$statesTemp = @()

$input = Read-Host -Prompt "Name an American state OR Type DONE to finish OR Type VIEW to view your current progress"

$statesTemp += $input

getType() returns a String and the count is the amount of keys in the String instead of the preconfigured array which treats each "(word)" as an object.

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.