Terminal tutorial. How to get a basic algorithm working
Embed
- Published on Oct 10, 2018
- We now have our own terminal tournament brought to you by Correlation One, a company whose mission is to connect global companies with the best data scientists, analysts and engineers in the world.
sign up for our competition now- terminal.c1games.com/competit...
Use the Handy Terminal Position Designer Matrix Thring
code-bullet.github.io/Handy-T...
watch the previous video about the competition
www.youtube.com/watch?v=qIW7C...
Twitter: code_bullet
Patreon: www.patreon.com/CodeBullet
Discord: discord.gg/UZDMYx5
Hey Evan, I love your vids. How did you start learning to code like this? And do you always use Java for your AI videos?
Thanks, Huge Fan :)
I believe he used JavaScript (very different from Java, name is deceiving) until he realised that python is godly for AI and has used that since
Code Bullet, I'm thinking of becoming a data engineer, and for that I need to learn the most difficult math. Would you say your mathematical skills contribute much to coding? If so, in what ways?
Would love it if you could do more programming tutorials in the future. I am trying to learn how to make a game and would appreciate any help I could get.
I love ur videos mate, don’t know anyone else who can explain code in such a hilarious way!
I remember the days when I still used my IDEs light mode.
@Steven Lu
Red texts on a green background? That sounds like hell tbh.
IDE/Editor themes that I like: Ayu Light/Dark/Mirage, One Light/Dark, Spacegray Oceanic Light/Dark, Zenburn (dark only). But light and dark themes are just matters of personal preferences. I have friends who code in TextEdit.app and friends who configured IDLE to have red text on a green background (and yes you can configure colors in IDLE).
and i remember when i used my ied’s light mode
@Wil probably learned to code yesterday
you had light mode
when i downloaded vscode it booted in dark mode.
Hey Evan. I know it's not related to all of this (you're doing awesome btw. Keep going) but are you participating in the ACM-ICPC this year?
I understood all of the python well enough. I do have one question, though (I ususally use IDLE for python, rather than Terminal). My question: Which website? when I search 'terminal', things like cmd come up.
I understand enough Python to barely follow along with what you are saying with frequent pauses to look at the coding think about what you said. And I am sorta semi-proud of that. I am still learning how to code. I don't know enough vocabulary to understand just from your words :c
Is it possible to use programs to have machine learning frameworks learn over multiple machines? I was thinking of using Tensorflow over 30 computers or so, but I did some research and I'm not sure it's possible. I had a look at Fabric in RPi clusters, seems like a possibility, but I don't think it would work with said frameworks.
5:44
"And that's it for my tutorial!
I hope it helps - probably didn't"
Yeah that about sums it up for me :D
Edit: not because it's a bad tutorial but because i have no idea wth you're talking about
@Matq You realise that they literally teach python to schoolchildren now, right?
Python is easy
thanks for the view u should probably try to gain some knowledge
well...i know what he´s talking about and let me tell you: it´s a bad tutorial xD but hey lets be honest...if you were looking for some high quality coding tutorials then you probably wouldnt be here in the first place
Whirlblaze haha same
Im a big fan and i love your videos, can you do a AI learns to play Evolution simulator?
I have to questions please :
How can i remove units?
Can I detect my enemys unit placing?
Can someone please answer those questions, thanks in advance.
The best place to ask these sorts of questions is at the forum on our site
I get so excited when I see you have a new video
Shame the past two have basically been ads.
We all do!
Is it possible to get whether a enemy unit has been placed in XY position, so our code can adapt to enemy strategies? Can't find it in the documentation.
If someone still doesn't know how to do it (because I didn't know what to do at first after reading this and inside the forum),
the game communicates with your code by a string in json format. It's the game_state_string in start() in the algocore file.
Look into the if-else statements there for the stateType == 1 which means it is currently in action phase. By default your code ignores the action phase and just does continue.
Just print the game_state_string in this phase and look what information it has in it. You want to look into "events", there the events (like breaches, spawns, moves each frame, etc..) are stored.
Because algocore has already built a dictionary out of the json string with "state = json.loads(game_state_string)", you can easily get a list of spawns by writing:
spawns = state["events"]["spawn"]
A single spawn element looks like this:
[[0,13], 2, "16", 1]
These informations are:
1. Location of the spawned unit
2. Unit type -> 2 = Destructor
3. A unique name for that unit to track it through other action phases
4. The player that spawned the unit -> 1 = blue (your algo), 2 = red (enemy)
Hope this helps someone to get this faster than I did
Wait, what does a dev do here?
thanks!
You can get the locations of firewalls from the gamestate, but to get where they spawned information units, you're going to have to look at action phase strings. Took me a couple of days staring at the starter code, but you want to start at the algo-core's file and add to the start() method.
game_state.game_map[x,y] returns a list of units at a location, check out the GameMap documentation
omg this guy is awesome i'm always excited when a new vid comes out
Just wondering, what programming language do you usually use (like for the hill climb racing game and stuff)
He usually says. This was python, but he also uses some others, like java.
he uses java script
I like the Terminal and stuff, but If I may suggest a game, try making an AI for Geometry Dash, I think it fits perfectly for an AI
Looks like Hill Climb has you stumped mate.
@JustMikaI didn't mean hl3, I meant more than 3 half life games;
Half-Life
Half-Life 2
Half-Life 2: Episode One
Half-Life 2: Episode Two
Sean Brennan but where is Half-life 3?
@JustMika :) Technically, they made more than 3 half-life games. Maybe, code bullet embedded a link to p2 of the enigma machine part 2 in his last episode of making hill climb, which sent you to a different video sharing site with him under another name. Hence, like Valve, there would technically be no part 3.
@Dani Paunov He completed the game itself, but he still has to do the AI.
I thought he's already completed it?
Just want to let you know I'm having a lot of fun coding for this competition so, thank you!
"Terminal tutorial"! 😱
I was shocked! I thought this would be your last video!
Sigh! What else could terminal stand for?
Can we ban machine learning / reinforcement learning algorithms? Literally just testing who has the better computer at that point.
I'd suggest zooming in on the code section you're working on in these tutorials just for ease of reading and such.
I just watch you bc you're funny but I am so lost when it comes to actually coding
I don't get what u doin but ur talking is really cool. I'm just here for listening. Super nice video 👌
And the simple but cool animations
Can you create an AI for Creeps? Just like this game it's not a true self learning AI, but you program robots to mine resources and build a base and create more resources and weapons and you can fight other people and take over their base to expand your "kingdom" or whatever it's called.
What else can you do with an AI other than making it learn how to master a game?
You should check out gladiabots for a similar sort of idea to this
I guess you would make a awsome programming teacher :D
I made a program that answers questions and learns the answers to new questions. That was when I was in eighth grade.
I have since forgotten literally everything I learned.
But hey, at least I have a cool computer program to talk to when I'm bored.
is there any way you could get me a way to access this computer you speak of?
I got this error : File "/tmp/algo6179746533272644505/algo_strategy.py", line 56, in on_turn
self.hello_world(game_state)
AttributeError: 'AlgoStrategy' object has no attribute 'hello_world'
Could someone please explain to me what I did wrong?
What's the main difference between python/c++ and java.
I know how to code in both python and c++.
you should make one on ‘master mind’ (code breaker)
code bullet, can you please do tutorials for people with no experience on coding please
What plugins do you use on Atom?
Python? That's nice, I just started learning it 2 weeks ago.
I know literally nothing about programming but I still watched this entire thing because you are fucking hilarious.
If u want another real time strategy coding game look up screeps.its amazingly fun once you get your ai up and running
Seriously it’s amazing 😆🤓
can you make some kind of browser that makes you use the internet like the good old days,
with dial up
still able to view modern sites but is loud as hell and takes all day
It's really not that difficult to simulate. You just need to play rock music on an apple device, cover the speakers and try to connect to the internet.
could you make some video on how an artificial intelligence in unity would work?
apparently this exists: unity3d.com/machine-learning dunno if that helps or not
I kinda tried to replicate what he did on his coded example of machine learning thing but I got roubles with transform.rotation and quaternions and lerps :v this is why I said that
it'd be pretty similar, though you'd probably make the program in luascript (as that's what unity uses)
I actually made a map editor in processing to do the same thing! i should have posted it
I was really confused because I thought this video would be about command line terminal, I see now that I was wrong
Only just started looking at Terminal - and it hard, but great brain stimulation..
5:18 array, not variable? Or is it both acceptable here?
array of vectors i guess
As a java dev, I've tried to copy letter for letter what you have and it still doesn't work... why does everyone say python is easier.
Wait I thought this was a game not half of a game and then they expect you to code the rest of it.
I thought I was going to be building a i inside of a GUI, so basically if I want to be good at this "game" I have to be able to create the game myself?
Pls do "AI learns to play Tetris"
Done.
Yay just what I’ve been waiting for
hey can i install tensorflow in this tterminal
Hey, do you have any experience coding in R?
I know absolutely nothing about coding, but I have to watch your videos still...
Any recommend on python IDE (I need it for class)
Daniel Bozic I’m a 3rd year comp sci student mostly using java and I didn’t know I could use python with eclipsed that’s what I usually use
Depends on how much experience you have coding and using IDE's you have, if you're new i would recommended something like VS Code or atom, or Eclipse + PyDev if you have some more experience, but IDE's and text editors are largely depends on personal preference so it's best you just download a few and try them out.
Thanks for another great video.
"Wow congratulations! You win an invitation to shut the f*ck up!" I'm dying
You have to show us your code, when the competition is over^^
What programming language would you suggest for A.I.?
Terminal currently supports python only, but we will be adding other languages soon
I saw your first video, but totally forgot about this event xD
Btw, `attempt_spawn` will auto check if it `can_spawn`, so that's useless.
TheXvid coding tutorials are so useful
What program does it use to program? I am new here....
Cheers from the #20 spot in global leaderboard
the green numbers you have on your character model in videos should be changed to spell 'code bullet' in binary or something
Good video.
Hey can you program the no internet game I’ve done it it is really easy😎
So which place did you score? Or is this not concluded yet?
You should try using Unity Engine when making your games, its free for personal use and supports JavaScript as well as C#. Just a suggestion so you don't have to keep using that god-awful excuse for a physics engine Box2D
Oh boi time to get used to python more for this
"You win an invitation to shut the fuck up"
I almost spat out my tea
To think this is the video that introduced me to this channel.
It's adorable that you think your viewers know wtf you're talking about.
Thanks for the position selecting program! Very kind of you, I'm sorry I'll be taking your tea towel.
@Caveman No.12 No, I was defeated.
Well, did you?
Code Bullet is the best guy ever and i will subscribe right now
Come on you accepted it as you said it
Only terminal I know is the unix based terminal; will this help?
Can we see your final version?
you gotta make a video of your winning run after you win the competition
I watched the video without even knowing what a terminal is
@Spedoilidoi Bash and similar programs like Zsh and Fish are "shell programs" or "shells"; they're not terminal emulators. Terminal emulators (or "terminals" for short) are the software that gives you the black window, whereas shells print prompts and let you enter commands. Apart from the default terminal emulators such as cmd (Windows), Terminal.app (OSX), and Konsole (KDE), there are also 3rd-party terminals (e.g. Windows Terminal, iTerm2.app (OSX), Alacritty (cross-platform)) that usually have certain enhanced aspects.
@Ghost Pepper you mean bash? bash is on most Linux distro as well as Unix distros (like macos)
Same
Yeah same
If you can code
*AI learns how to play **_Super Mario Bros_*
You won and gain a subscriber as a reward
You should try to make an ai for tetris!
THANK YOU!
YOUR GETTING SOOO BIG!!!! Soon your TheXvid channel will be out of its diapers and onto college... 😀😢
Me: Tries to learn BASH shell.
TheXvid: You meant Linux Terminal!?
Did I see Atom at the start? Atom is awesome.
Do a video on AI learning how to play Tetris
I thought this was a game where you didn't have to script anything, I don't have much knowledge about programming
no it's a game entirely about scripting
m.heise.de/tr/artikel/Ein-voellig-neues-Kapitel-der-Kuenstlichen-Intelligenz-4188415.html This is insanely relevant for everyone who is interested in machine learning.
When do you do AI things again?
I like his other names for the folder
"I hope it helps,probably didn't" hahah true
With Evan you never know what 'fuck' is gonna get beeped and what 'fuck' left uncensored. ;D
Thought Terminal literally meant Bash Terminal.
hey can you program skynet pls?
Commenting from 2020.. At this point I think we'd all welcome skynet as our new overlord.
Clearly humans can't do this shit successfully.. Let's give the machines a shot.
*_Soviet Russia intensifies_*
You don't program Skynet, for Skynet programs YOU
I would love to see it
And here we see humanity in its natural habitat.
Am I the only who watches these in order to feel smart😰
A basic tutorial for coding stuff pls
Last programming language I dabbled with was Microsoft Visual C#.
That was years ago. Though some terms come back to me after watching this vid. Now this all looks like gibberish.
Thank you.
Self learning Ai plays Mirror's Edge?
You should do AI playing geometry dash
It is as easy as it seams
Can you make a video of the tournament?
1:53 - ABSOLUTE SAVAGE
make another fusion video like the snake one!