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!
#How can I run ArrayVisualizer?
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
Can you open a terminal / powershell / cmd.exe and try running java --version and jar --version?
bro, this is so cool
I'm not sure how to do that. Can you tell me step by step?
I know, right?
open the start menu
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
okay so this is what we call "the terminal"
you write commands here and they do stuff
try writing echo hello
and hitting enter
it said hello back
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
It's telling me the version. It's 22.0.2
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
I have the ArrayVisualizer-master folder
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
I have it on my desktop
C:\Users___
PS C:\Users___>
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
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
okay
so clearly Desktop wasnt the directory right below you
run ls to list all the files and folders in your current directory
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
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
Mode LastWriteTime Length Name
d----- 4/2/2019 1:27 PM ArrayVisualizer-master
now cd ArrayVisualizer-master
Got it
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
Just making sure, I type in "java src/array/visualizer/ArrayVisualizer.java" next to PS C:\Users\laura\Downloads\ArrayVisualizer-master>?
yep
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
it should have opened the program
I think you have to type it all in one line
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
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?
got it
okay now in that file put src/array/visualizer/ArrayVisualizer.java
I just put that in a notepad file, right?
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
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
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
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
I changed the file to .txt
okay so make sure src/array/visualizer/ArrayVisualizer.java is in there
then run java @run.txt
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"
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
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! 😄