Terminal tutorial. How to get a basic algorithm working

Share
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

Comments • 357

  • Bruno
    Bruno 3 years ago +6

    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 :)

    • Hi there!
      Hi there! 2 years ago +2

      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

  • Fainted
    Fainted 3 years ago +3

    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?

  • Rohan Sharma
    Rohan Sharma 3 years ago +2

    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.

  • Gregpr07
    Gregpr07 3 years ago

    I love ur videos mate, don’t know anyone else who can explain code in such a hilarious way!

  • Shifty
    Shifty 3 years ago +78

    I remember the days when I still used my IDEs light mode.

    • Zoetje
      Zoetje 4 months ago

      @Steven Lu
      Red texts on a green background? That sounds like hell tbh.

    • Steven Lu
      Steven Lu Year ago

      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).

    • Blarb521
      Blarb521 Year ago

      and i remember when i used my ied’s light mode

    • ViniThePooh
      ViniThePooh Year ago +1

      @Wil probably learned to code yesterday

    • Thije Wissema
      Thije Wissema Year ago

      you had light mode
      when i downloaded vscode it booted in dark mode.

  • Vishwang Dave
    Vishwang Dave 3 years ago

    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?

  • Skye Brennan
    Skye Brennan 2 years ago

    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.

  • Kalahatze
    Kalahatze 3 years ago +1

    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

  • LewisTehMinerz
    LewisTehMinerz 3 years ago

    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.

  • Whirlblaze
    Whirlblaze 3 years ago +230

    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

    • Skye Brennan
      Skye Brennan 2 years ago

      @Matq You realise that they literally teach python to schoolchildren now, right?

    • Matq
      Matq 3 years ago +2

      Python is easy

    • Not You
      Not You 3 years ago

      thanks for the view u should probably try to gain some knowledge

    • Kaito
      Kaito 3 years ago +13

      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

    • COVID- 19
      COVID- 19 3 years ago +2

      Whirlblaze haha same

  • Axeon Axolotl
    Axeon Axolotl 3 years ago

    Im a big fan and i love your videos, can you do a AI learns to play Evolution simulator?

  • MJ
    MJ 3 years ago +1

    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.

    • Ryan McPartlan
      Ryan McPartlan 3 years ago

      The best place to ask these sorts of questions is at the forum on our site

  • DatChoob
    DatChoob 3 years ago +130

    I get so excited when I see you have a new video

    • Jmac5280
      Jmac5280 3 years ago +2

      Shame the past two have basically been ads.

    • Nuunu Markus
      Nuunu Markus 3 years ago

      We all do!

  • Lorddirt
    Lorddirt 3 years ago +6

    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.

    • ThePhoenix107
      ThePhoenix107 3 years ago +2

      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

    • Villfuk 02
      Villfuk 02 3 years ago

      Wait, what does a dev do here?

    • Lorddirt
      Lorddirt 3 years ago

      thanks!

    • Leland Hepworth
      Leland Hepworth 3 years ago +1

      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.

    • Ryan McPartlan
      Ryan McPartlan 3 years ago +1

      game_state.game_map[x,y] returns a list of units at a location, check out the GameMap documentation

  • TheThunderbird
    TheThunderbird 3 years ago

    omg this guy is awesome i'm always excited when a new vid comes out

  • Oliver Bryan
    Oliver Bryan 3 years ago +2

    Just wondering, what programming language do you usually use (like for the hill climb racing game and stuff)

    • Skye Brennan
      Skye Brennan 2 years ago

      He usually says. This was python, but he also uses some others, like java.

    • Hyper
      Hyper 2 years ago

      he uses java script

  • Test01
    Test01 3 years ago

    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

  • EweChewBrrr
    EweChewBrrr 3 years ago +513

    Looks like Hill Climb has you stumped mate.

    • Skye Brennan
      Skye Brennan 2 years ago

      @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

    • JustMika
      JustMika 2 years ago

      Sean Brennan but where is Half-life 3?

    • Skye Brennan
      Skye Brennan 2 years ago

      @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.

    • Jędrzej Kawa
      Jędrzej Kawa 3 years ago

      @Dani Paunov He completed the game itself, but he still has to do the AI.

    • Dani Paunov
      Dani Paunov 3 years ago +1

      I thought he's already completed it?

  • G̨̛h̴͘͞0̴͟5̛7̷͝

    Just want to let you know I'm having a lot of fun coding for this competition so, thank you!

  • Tom Riddle
    Tom Riddle 3 years ago +1

    "Terminal tutorial"! 😱
    I was shocked! I thought this would be your last video!
    Sigh! What else could terminal stand for?

  • Thomas Hurrell
    Thomas Hurrell 3 years ago

    Can we ban machine learning / reinforcement learning algorithms? Literally just testing who has the better computer at that point.

  • Aldude
    Aldude 3 years ago

    I'd suggest zooming in on the code section you're working on in these tutorials just for ease of reading and such.

  • JustAido
    JustAido 3 years ago

    I just watch you bc you're funny but I am so lost when it comes to actually coding

  • fati.
    fati. 3 years ago +16

    I don't get what u doin but ur talking is really cool. I'm just here for listening. Super nice video 👌

    • Liam Morris
      Liam Morris 3 years ago

      And the simple but cool animations

  • Naud van Dalen
    Naud van Dalen 3 years ago +1

    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.

  • Oktay
    Oktay 3 years ago

    What else can you do with an AI other than making it learn how to master a game?

  • Oliver Wilson
    Oliver Wilson 3 years ago +1

    You should check out gladiabots for a similar sort of idea to this

  • Pietflosse
    Pietflosse 3 years ago

    I guess you would make a awsome programming teacher :D

  • yttrium
    yttrium 3 years ago

    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.

    • N00b GamingFTW
      N00b GamingFTW 3 years ago

      is there any way you could get me a way to access this computer you speak of?

  • SkylarTheSeer
    SkylarTheSeer 3 years ago

    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?

  • Utkarsh Aryan
    Utkarsh Aryan 3 years ago

    What's the main difference between python/c++ and java.
    I know how to code in both python and c++.

  • Skittleshunter64
    Skittleshunter64 3 years ago

    you should make one on ‘master mind’ (code breaker)

  • Abdullah Irfan
    Abdullah Irfan 3 years ago

    code bullet, can you please do tutorials for people with no experience on coding please

  • Cristian Vie
    Cristian Vie 3 years ago

    What plugins do you use on Atom?

  • caveman
    caveman 3 years ago

    Python? That's nice, I just started learning it 2 weeks ago.

  • XdivineExp
    XdivineExp 3 years ago

    I know literally nothing about programming but I still watched this entire thing because you are fucking hilarious.

  • Zst.p
    Zst.p 3 years ago

    If u want another real time strategy coding game look up screeps.its amazingly fun once you get your ai up and running

    • Zst.p
      Zst.p 3 years ago

      Seriously it’s amazing 😆🤓

  • lazermcshootypants
    lazermcshootypants 3 years ago +1

    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

    • Skye Brennan
      Skye Brennan 2 years ago

      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.

  • Dídac Cayuela
    Dídac Cayuela 3 years ago

    could you make some video on how an artificial intelligence in unity would work?

    • BuckieTheCat
      BuckieTheCat 3 years ago +1

      apparently this exists: unity3d.com/machine-learning dunno if that helps or not

    • Dídac Cayuela
      Dídac Cayuela 3 years ago

      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

    • BuckieTheCat
      BuckieTheCat 3 years ago

      it'd be pretty similar, though you'd probably make the program in luascript (as that's what unity uses)

  • Ryan Webster
    Ryan Webster 3 years ago

    I actually made a map editor in processing to do the same thing! i should have posted it

  • Cameron Bauserman
    Cameron Bauserman 3 years ago

    I was really confused because I thought this video would be about command line terminal, I see now that I was wrong

  • coxy ofnewp
    coxy ofnewp 3 years ago

    Only just started looking at Terminal - and it hard, but great brain stimulation..

  • Brandonaerys
    Brandonaerys 3 years ago

    5:18 array, not variable? Or is it both acceptable here?

  • TheForeman
    TheForeman 3 years ago

    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.

  • RyanWake bradtelle
    RyanWake bradtelle 3 years ago

    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?

  • Neo 20000
    Neo 20000 3 years ago +12

    Pls do "AI learns to play Tetris"

  • Red Equals Black
    Red Equals Black 3 years ago

    Yay just what I’ve been waiting for

  • Vishnu Sumanth
    Vishnu Sumanth 3 years ago

    hey can i install tensorflow in this tterminal

  • aharte36
    aharte36 3 years ago

    Hey, do you have any experience coding in R?

  • hermulv
    hermulv 3 years ago

    I know absolutely nothing about coding, but I have to watch your videos still...

  • a name
    a name 3 years ago

    Any recommend on python IDE (I need it for class)

    • a name
      a name 3 years ago

      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

    • TwisterMonkey
      TwisterMonkey 3 years ago

      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.

  • Lord Kirtash
    Lord Kirtash 3 years ago

    Thanks for another great video.

  • CammyFries
    CammyFries 3 years ago +7

    "Wow congratulations! You win an invitation to shut the f*ck up!" I'm dying

  • lonelyPorterCH
    lonelyPorterCH 3 years ago

    You have to show us your code, when the competition is over^^

  • Nic
    Nic 3 years ago

    What programming language would you suggest for A.I.?

    • Ryan McPartlan
      Ryan McPartlan 3 years ago

      Terminal currently supports python only, but we will be adding other languages soon

  • Wurstfinger1337
    Wurstfinger1337 3 years ago +1

    I saw your first video, but totally forgot about this event xD

  • crides
    crides 3 years ago

    Btw, `attempt_spawn` will auto check if it `can_spawn`, so that's useless.

  • Tactical
    Tactical 5 months ago +1

    TheXvid coding tutorials are so useful

  • Bruce Lee
    Bruce Lee 3 years ago

    What program does it use to program? I am new here....

  • Villfuk 02
    Villfuk 02 3 years ago +2

    Cheers from the #20 spot in global leaderboard

  • lordiator
    lordiator 3 years ago

    the green numbers you have on your character model in videos should be changed to spell 'code bullet' in binary or something

  • whale
    whale 3 years ago +2

    Good video.

  • PieceCtrlObama
    PieceCtrlObama 3 years ago

    Hey can you program the no internet game I’ve done it it is really easy😎

  • Dave Asher
    Dave Asher 3 years ago

    So which place did you score? Or is this not concluded yet?

  • Veyren Wolf
    Veyren Wolf 3 years ago

    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

  • エディー
    エディー 3 years ago

    Oh boi time to get used to python more for this

  • Alexi
    Alexi 3 years ago

    "You win an invitation to shut the fuck up"
    I almost spat out my tea

  • Universal 82
    Universal 82 Year ago

    To think this is the video that introduced me to this channel.

  • Blood Bath and Beyond - Pop Goes Metal Covers

    It's adorable that you think your viewers know wtf you're talking about.

  • Brendan Russell
    Brendan Russell 3 years ago

    Thanks for the position selecting program! Very kind of you, I'm sorry I'll be taking your tea towel.

  • RubyPiec
    RubyPiec 3 years ago

    Code Bullet is the best guy ever and i will subscribe right now
    Come on you accepted it as you said it

  • Rahmed
    Rahmed 3 years ago

    Only terminal I know is the unix based terminal; will this help?

  • Branden Allen
    Branden Allen 3 years ago

    Can we see your final version?

  • JinJanMcFlan
    JinJanMcFlan 3 years ago

    you gotta make a video of your winning run after you win the competition

  • Nicholas Nguyen
    Nicholas Nguyen 3 years ago +91

    I watched the video without even knowing what a terminal is

    • Steven Lu
      Steven Lu Year ago

      @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.

    • Spedoilidoi
      Spedoilidoi 2 years ago

      @Ghost Pepper you mean bash? bash is on most Linux distro as well as Unix distros (like macos)

    • Ragge
      Ragge 3 years ago

      Same

    • Jacob Reginio
      Jacob Reginio 3 years ago +1

      Yeah same

  • Doom Cannon
    Doom Cannon 3 years ago

    If you can code
    *AI learns how to play **_Super Mario Bros_*
    You won and gain a subscriber as a reward

  • Ruben
    Ruben 3 years ago

    You should try to make an ai for tetris!

  • Elliott Bryce
    Elliott Bryce 3 years ago

    THANK YOU!

  • Farkle Griffen
    Farkle Griffen 3 years ago +4

    YOUR GETTING SOOO BIG!!!! Soon your TheXvid channel will be out of its diapers and onto college... 😀😢

  • Mariano Rodriguez

    Me: Tries to learn BASH shell.
    TheXvid: You meant Linux Terminal!?

  • Father Agnostus
    Father Agnostus 3 years ago

    Did I see Atom at the start? Atom is awesome.

  • fatSNICKER
    fatSNICKER 3 years ago

    Do a video on AI learning how to play Tetris

  • Rein
    Rein 3 years ago

    I thought this was a game where you didn't have to script anything, I don't have much knowledge about programming

    • BuckieTheCat
      BuckieTheCat 3 years ago

      no it's a game entirely about scripting

  • Loopiloop
    Loopiloop 3 years ago

    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.

  • Jens C
    Jens C 3 years ago

    When do you do AI things again?

  • Loading 0319
    Loading 0319 3 years ago

    I like his other names for the folder

  • YO HIGH
    YO HIGH 3 years ago

    "I hope it helps,probably didn't" hahah true

  • SunshineSeraphim
    SunshineSeraphim 3 years ago

    With Evan you never know what 'fuck' is gonna get beeped and what 'fuck' left uncensored. ;D

  • TheCreeperTrack
    TheCreeperTrack 3 years ago

    Thought Terminal literally meant Bash Terminal.

  • Ares
    Ares 3 years ago +246

    hey can you program skynet pls?

    • william dowling
      william dowling Year ago

      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.

    • Dango
      Dango 2 years ago +1

      *_Soviet Russia intensifies_*

    • the wizard of deez nuts
      the wizard of deez nuts 3 years ago +3

      You don't program Skynet, for Skynet programs YOU

    • T-800
      T-800 3 years ago +12

      I would love to see it

    • yttrium
      yttrium 3 years ago +13

      And here we see humanity in its natural habitat.

  • Double H
    Double H 3 years ago

    Am I the only who watches these in order to feel smart😰

  • Streambotnt
    Streambotnt 3 years ago

    A basic tutorial for coding stuff pls

  • This comment is literally

    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.

  • Exxotekcs
    Exxotekcs 3 years ago

    Thank you.

  • Quapi
    Quapi 3 years ago +2

    Self learning Ai plays Mirror's Edge?

  • Bailey Stabler
    Bailey Stabler 3 years ago

    You should do AI playing geometry dash

  • Australia’s Real Queen

    It is as easy as it seams

  • massi nicol
    massi nicol 3 years ago

    Can you make a video of the tournament?

  • Mason Myre
    Mason Myre 3 years ago

    1:53 - ABSOLUTE SAVAGE

  • ATSArtanis
    ATSArtanis 3 years ago

    make another fusion video like the snake one!