Tic Tac Toe Android Studio Kotlin Tutorial | Noughts & Crosses

Поділитися
Вставка
  • Опубліковано 10 жов 2024

КОМЕНТАРІ • 29

  • @vedantk23
    @vedantk23 2 роки тому +3

    Best video on Tic Tac Toe game built using Kotlin in UA-cam. Keep it up Cal Sir.

  • @greylabservice444
    @greylabservice444 Рік тому

    The big grateful from Kazakhstan! You are the best!

  • @Ep3o
    @Ep3o 8 місяців тому

    Hey! For those finding this tutorial, you may need to change up the "fun boardTapped(view: View)" function, as it no longer works in the current version (literally crashes if you press anything)
    My work around was setting each button like so in the oncreate function:
    binding.a1.setOnClickListener(this)
    binding.a2.setOnClickListener(this)
    etc.
    Then create
    override fun onClick(v: View?) {
    addToBoard(v as Button)
    }
    instead of the "fun boardTapped(view: View)" function
    be sure to also add: class MainActivity : AppCompatActivity(), View.OnClickListener {

    • @Ep3o
      @Ep3o 8 місяців тому

      Also, to get around draw popping up if you fill-up the board but also win I changed:
      override fun onClick(v: View?) {
      addToBoard(v as Button)
      var victory = false
      if(checkForVictory(NOUGHT)){
      victory = true
      noughtsScore ++
      result("Noughts Win!")
      }
      if(checkForVictory(CROSS)){
      victory = true
      crossesScore ++
      result("Crosses Win!")
      }
      if(fullBoard()) {
      if (victory == false) {
      result("Draw")
      }
      }

    • @Ep3o
      @Ep3o 8 місяців тому

      Hopefully this can save someone new hours, Kotlin having frequent updates rendering old tutorials useless has made my life hell

  • @bigbad123321
    @bigbad123321 Рік тому

    Thank you so much. I needed this for a University module I'm doing. I just have to add additional features to it now, which shouldn't be too bad. If I can work a quarter as quickly as you one day I'll be happy.

    • @mokshpatel3108
      @mokshpatel3108 Рік тому

      Hii bro I require it for the same can you please help me how to download it using source code 😿😿

  • @mysgrown
    @mysgrown 3 роки тому +2

    Thank you so much Cal Sir. Your videos are very helpful 💌

  • @BitMavrick
    @BitMavrick Рік тому

    Hey Cal, I think you should make a playlist about layout design using XML, I saw lots of UA-cam tutorials but I'm not able to find any proper playlist for learning layout or android UI design using XML. Thank you.

  • @kamalCode
    @kamalCode 3 роки тому +4

    Sir, please JetPack kotlin complete advanced tuotorial updated with Ecommerce ui design

  • @IksanArisandi
    @IksanArisandi 8 місяців тому

    thanks for the code, may I use it for commercial purposes ?

  • @sourabhjadhav4621
    @sourabhjadhav4621 2 роки тому

    Good Video Man. Love to see more!

  • @marcinaszyk8387
    @marcinaszyk8387 2 роки тому

    If the win happens at the last move, there is a draw and win at the same time ;) great video!

  • @mrtruthvirtue8752
    @mrtruthvirtue8752 3 роки тому

    Hi , Cal.. You're amazing. Pls don't give up , okey?

  • @aritrps1866
    @aritrps1866 2 роки тому

    Lâu quá rồi mới nghe anh Đức Phúc hát, thích quá đi thôi.

  • @reliefsounds1
    @reliefsounds1 Рік тому

    I have problem in online that show layout margin not found

  • @manvendrasingh5629
    @manvendrasingh5629 Рік тому

    Hi, as soon as I am clicking on board the application is minimising automatically

  • @zhbeka9732
    @zhbeka9732 Рік тому

    Why my boardTapped function wasnt created automtically?

  • @preetthee
    @preetthee 2 роки тому

    Nice explaining. Keep it up.

  • @sadpoetry2135
    @sadpoetry2135 3 роки тому +1

    hy call need help me plz
    i have a make to prayer times list in andoid st

    • @CodeWithCal
      @CodeWithCal  3 роки тому

      A list view application?
      ua-cam.com/video/6qYNxtG0LNE/v-deo.html

  • @amitabhkumar7671
    @amitabhkumar7671 2 роки тому

    I am unable to find activity main binding in my syste,

    • @CodeWithCal
      @CodeWithCal  2 роки тому

      Have you enabled view binding in the build Gradle?

    • @imaginedave4094
      @imaginedave4094 9 місяців тому

      @@CodeWithCal Same with me, i enabled it and somehow it still shows "unresolved reference" i actually tried everything and it doesnt work

  • @SpideyCents
    @SpideyCents 3 роки тому

    love it

  • @SumoPixelPlay
    @SumoPixelPlay Рік тому

    Bro how to make games

  • @bestiegreatie8752
    @bestiegreatie8752 2 роки тому

    unresolved error for me