#How can I run ArrayVisualizer?

1 messages · Page 1 of 1 (latest)

winged stream
#

Hi! I came across this video again after a few years, the Color Circle, or Array Visualizer. https://www.youtube.com/watch?v=y9Ecb43qw98 It's very satisfying to watch and I want to put it onto my computer. The description only lists a Github link. I downloaded what was there and I'm quite new to coding. Does anyone have any basic instructions on how to get this running? I just downloaded Java and JDK, but I'm totally confused on what to do. I would really appreciate the help. Thanks!

robust scarabBOT
#

<@&987246399047479336> please have a look, thanks.

pearl wadi
#

Can you open a terminal / powershell / cmd.exe and try running java --version and jar --version?

sudden lake
#

bro, this is so cool

winged stream
winged stream
pearl wadi
#

type in powershell

#

in the search

#

it should be a blue icon and when you open it it should give you a blue window

#

or black, maybe

winged stream
#

I got it open! 🙂

#

Powershell, that is

pearl wadi
#

okay so this is what we call "the terminal"

#

you write commands here and they do stuff

#

try writing echo hello

#

and hitting enter

winged stream
#

it said hello back

pearl wadi
#

so echo is the name of a program on your system

#

and everything you put to the right of the program name is an "argument" to the program

#

now try java --version

winged stream
#

It's telling me the version. It's 22.0.2

pearl wadi
#

cool

#

now download the program

#

you should be able to download a zip file from the github page

#

then extract it somewhere on your computer

winged stream
#

I have the ArrayVisualizer-master folder

pearl wadi
#

okay

#

so now we need to figure out the full path to that folder

#

it should look like C:/users/something/.../ArrayVisualizer-master

#

then run

winged stream
#

I have it on my desktop

pearl wadi
#

hmm

#

okay lets try this instead

#

in powershell type pwd

winged stream
#

C:\Users___

PS C:\Users___>

pearl wadi
#

aight

#

i'll assume you got the directory

winged stream
#

Yep lolz

#

Just typing what I'm seeing

pearl wadi
#

so whenever you run a command in the terminal that is done "in the context of" a directory

#

we need to navigate to the directory with the code in it

#

so try cd Desktop

#

cd stands for change directory

winged stream
#

cd : Cannot find path 'C:\Users\laura\Desktop' because it does not exist.
At line:1 char:1

  • cd Desktop
  •   + CategoryInfo          : ObjectNotFound: (C:\Users\laura\Desktop:String) [Set-Location], ItemNotFoundException
      + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
pearl wadi
#

okay

#

so clearly Desktop wasnt the directory right below you

#

run ls to list all the files and folders in your current directory

winged stream
#

PS C:\Users\laura> ls

Directory: C:\Users\laura

Mode LastWriteTime Length Name


d----- 6/3/2024 11:57 PM .cache
d----- 6/13/2024 9:35 PM .glaze
d----- 9/28/2023 5:50 PM .ms-ad
d-r--- 6/29/2023 4:44 PM Contacts
d-r--- 5/11/2024 1:40 AM Creative Cloud Files Personal Account [email protected]
6AD1453B5D9509E60A495F95@AdobeID
d----- 6/29/2023 4:47 PM Documents
dar--- 8/26/2024 8:31 PM Downloads
d-r--- 6/29/2023 4:44 PM Favorites
d-r--- 6/29/2023 4:44 PM Links
d-r--- 6/29/2023 4:44 PM Music
dar--- 12/1/2023 1:30 PM OneDrive
d----- 6/29/2023 4:47 PM Pictures
d-r--- 6/29/2023 4:44 PM Saved Games
d-r--- 6/29/2023 5:03 PM Searches
d-r--- 4/24/2024 12:01 AM Videos
-a---- 8/26/2024 7:17 PM 188 .gitconfig

pearl wadi
#

huh

#

where is your desktop?

#

can you move the -master folder to your downloads?

#

just so we can keep goin

#

then cd Downloads and ls again

winged stream
#

Mode LastWriteTime Length Name


d----- 4/2/2019 1:27 PM ArrayVisualizer-master

pearl wadi
#

now cd ArrayVisualizer-master

winged stream
#

Got it

pearl wadi
#

okay now

#

you have java 22

#

so you don't need all those instructions

#

just run java src/array/visualizer/ArrayVisualizer.java

#

java followed by the path of the file to run

winged stream
#

Just making sure, I type in "java src/array/visualizer/ArrayVisualizer.java" next to PS C:\Users\laura\Downloads\ArrayVisualizer-master>?

pearl wadi
#

yep

winged stream
#

Okay, I typed in Java as its own word, then a list of things came up. Next I typed in src/array/visualizer/ArrayVisualizer.java and it's waiting for me to do something else

pearl wadi
#

it should have opened the program

sudden lake
winged stream
#

I probably made the mistake of making java its own word. Should java and src be spaced? It's kind of confusing that Discord puts src into a new line

pearl wadi
#

java src/array/visualizer/ArrayVisualizer.java

#

java <space> src/...

winged stream
#

I got it! Thank you so much for your help! Is there a way I can save this as a shortcut or does it need to be typed in again?

pearl wadi
#

yes

#

can you make a file in that folder named run?

winged stream
#

got it

pearl wadi
#

okay now in that file put src/array/visualizer/ArrayVisualizer.java

winged stream
#

I just put that in a notepad file, right?

pearl wadi
#

yeah

#

then save it

#

and run ls

#

so we can see that it is there

winged stream
#

Mode LastWriteTime Length Name


d----- 8/26/2024 10:50 PM Run
d----- 4/2/2019 1:27 PM src
------ 4/2/2019 1:27 PM 483 .gitattributes
------ 4/2/2019 1:27 PM 15 .gitignore
------ 4/2/2019 1:27 PM 1063 LICENSE
------ 4/2/2019 1:27 PM 110 manifest.mf
------ 4/2/2019 1:27 PM 814 README.md

#

I just did this:

#

PS C:\Users\laura\Downloads\ArrayVisualizer-master> cd Run
PS C:\Users\laura\Downloads\ArrayVisualizer-master\Run> ls

Directory: C:\Users\laura\Downloads\ArrayVisualizer-master\Run

Mode LastWriteTime Length Name


-a---- 8/26/2024 10:50 PM 41 ArrayVisualizer.java

PS C:\Users\laura\Downloads\ArrayVisualizer-master\Run>

#

I wasn't sure if I named the program correctly

pearl wadi
#

err

#

no

#

run shouldn't be a folder

#

literally make a file named run

#

not ArrayVisualizer.java

#

also you need to cd .. to go back up a directory

winged stream
#

Sorry, I'm pretty new. Though I'm learning a lot, at least ^^

#

PS C:\Users\laura\Downloads> cd ArrayVisualizer-master
PS C:\Users\laura\Downloads\ArrayVisualizer-master> ls

Directory: C:\Users\laura\Downloads\ArrayVisualizer-master

Mode LastWriteTime Length Name


d----- 4/2/2019 1:27 PM src
------ 4/2/2019 1:27 PM 483 .gitattributes
------ 4/2/2019 1:27 PM 15 .gitignore
------ 4/2/2019 1:27 PM 1063 LICENSE
------ 4/2/2019 1:27 PM 110 manifest.mf
------ 4/2/2019 1:27 PM 814 README.md
-a---- 8/26/2024 10:50 PM 41 run.java

pearl wadi
#

okay well

#

let me show you how this will work

#

java @run.java

#

but i would name it run.txt or something

#

basically if you put some arguments in a file like that you can put @ then the file

#

and it will pretend as if all the arguments in the file were there

#

(not all tools support this, but the java ones do)

#

so thats a way you can write it down and use it

winged stream
#

I changed the file to .txt

pearl wadi
#

okay so make sure src/array/visualizer/ArrayVisualizer.java is in there

#

then run java @run.txt

winged stream
#

It's telling me:

#

PS C:\Users\laura\Downloads\ArrayVisualizer-master> java @run.txt
At line:1 char:6

  • java @run.txt
  •  ~~~~
    

The splatting operator '@' cannot be used to reference variables in an expression. '@run' can be used only as an
argument to a command. To reference variables in an expression use '$run'.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : SplattingNotPermitted

#

and src/array/visualizer/ArrayVisualizer.java is in "run.txt"

pearl wadi
#

oh windows

#

java "@run.txt"

#

I spend most of my time using a shell called bash so i forget the rules of powershell

#

they are all like...70% the same

winged stream
#

No problem, I understand lolz

#

Ahhh, I got it. I had to include the quotation marks. I was confused for a sec there haha

#

PS C:\Users\laura> cd Downloads
PS C:\Users\laura\Downloads> cd ArrayVisualizer-master
PS C:\Users\laura\Downloads\ArrayVisualizer-master> java "@run.txt"

#

Gonna leave this here for future reference lolz Thanks again for your help! 😄