Tic Tac Toe Android Studio Kotlin Tutorial | Noughts & Crosses

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 29

  • @vedantk23
    @vedantk23 2 года назад +3

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

  • @Ep3o
    @Ep3o 10 месяцев назад

    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 10 месяцев назад

      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 10 месяцев назад

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

  • @greylabservice444
    @greylabservice444 Год назад

    The big grateful from Kazakhstan! You are the best!

  • @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 💌

  • @kamalCode
    @kamalCode 3 года назад +4

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

  • @IksanArisandi
    @IksanArisandi 9 месяцев назад

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

  • @sourabhjadhav4621
    @sourabhjadhav4621 2 года назад

    Good Video Man. Love to see more!

  • @mrtruthvirtue8752
    @mrtruthvirtue8752 3 года назад

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

  • @BitMavrick
    @BitMavrick Год назад

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

  • @aritrps1866
    @aritrps1866 2 года назад

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

  • @marcinaszyk8387
    @marcinaszyk8387 2 года назад

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

  • @preetthee
    @preetthee 3 года назад

    Nice explaining. Keep it up.

  • @reliefsounds1
    @reliefsounds1 Год назад

    I have problem in online that show layout margin not found

  • @zhbeka9732
    @zhbeka9732 Год назад

    Why my boardTapped function wasnt created automtically?

  • @manvendrasingh5629
    @manvendrasingh5629 Год назад

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

  • @SpideyCents
    @SpideyCents 3 года назад

    love it

  • @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 11 месяцев назад

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

  • @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?
      ruclips.net/video/6qYNxtG0LNE/видео.html

  • @SumoPixelPlay
    @SumoPixelPlay Год назад

    Bro how to make games

  • @bestiegreatie8752
    @bestiegreatie8752 2 года назад

    unresolved error for me