Lanka Developers Community

    Lanka Developers

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Shop
    1. Home
    2. thilina dilshan
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 6
    • Best 4
    • Controversial 0
    • Groups 0

    thilina dilshan

    @thilina dilshan

    A dedicated person who enjoys working hard and living with balance. A good team player with the ability to work effectively with others. I put my heart, mind, and soul into every act for success.

    4
    Reputation
    227
    Profile views
    6
    Posts
    0
    Followers
    0
    Following
    Joined Last Online
    Website thilina-dilshan.vercel.app/

    thilina dilshan Unfollow Follow

    Best posts made by thilina dilshan

    • Python BirthDay Reminder(Simple code)

      dicts = {}

      while True:
      print("...Birth Day App...\n")
      print("1.Show Birth Days")
      print("2.Add Birth Days")
      print("3.Exit\n")

      choice = int(input("What is your choice:"))
      if choice == 1:
          if len(dicts.keys()) == 0:
              print("No Birth Days yet..\n")
          else:
              name = input("Enter friend's name:")
              birth_day = dicts.get(name, "No data found")
              print(birth_day,'\n')
      
      elif choice == 2:
          name = input("Enter name:")
          birth_day = input("Enter birth Day:")
          dicts[name] = birth_day
          print("Data Added\n")
      
      elif choice == 3:
          print("Thanks for using birth Day reminder app..")
          break
      else:
          print("Choose a valid option...\n")
      
      posted in Programming
      thilina dilshan
      thilina dilshan
    • RE: What are good technologies to learn in sri lanka

      For the web frontend development => React, Vue, angular ( React has the best job market )
      For mobile development for cross platforms => Flutter, React Native ( Not sure what will provide the best job market, but Flutter is superior )
      For backend => .NET, NodeJs, Java, Python

      posted in General Discussion
      thilina dilshan
      thilina dilshan
    • RE: Python BirthDay Reminder(Simple code)

      @dev_lak issarahata balamu machn....

      posted in Programming
      thilina dilshan
      thilina dilshan
    • Race game using python

      import turtle
      from turtle import Turtle
      import random

      turtle.title('Turtle rance')
      turtle.bgcolor('grey')

      turtle.color('white')
      turtle.penup()
      turtle.goto(-100, 200)
      turtle.write('Turtle race', font=('Arial', 30, 'bold'))

      turtle.goto(-400, -200)
      turtle.color('brown')
      size = [800, 120, 800, 120]
      turtle.speed(100)
      turtle.begin_fill()

      for i in range(4):
      turtle.forward(size[i])
      turtle.right(90)
      turtle.end_fill()

      turtle.shape('square')
      turtle.color('dark green')
      for i in range(10):
      turtle.goto(300, 150 - (i*30))
      turtle.stamp()

      for i in range(10):
      turtle.goto(310, 140 - (i*30))
      turtle.stamp()

      t1 = Turtle()
      t1.penup()
      t1.goto(-200, 0)
      t1.shape('turtle')
      t1.color('yellow')

      t2 = Turtle()
      t2.penup()
      t2.goto(-200, 50)
      t2.shape('turtle')
      t2.color('blue')

      t3 = Turtle()
      t3.penup()
      t3.goto(-200, 100)
      t3.shape('turtle')
      t3.color('black')

      t4 = Turtle()
      t4.penup()
      t4.goto(-200, -50)
      t4.shape('turtle')
      t4.color('red')

      d1 = 0
      d2 = 0
      d3 = 0
      d4 = 0

      for i in range(200):
      ran1 = random.randint(1, 25)
      ran2 = random.randint(1, 25)
      ran3 = random.randint(1, 25)
      ran4 = random.randint(1, 25)

      t1.forward(ran1)
      d1 += ran1
      t2.forward(ran2)
      d2 += ran2
      t3.forward(ran3)
      d3 += ran3
      t4.forward(ran4)
      d4 += ran4
      
      if d1 >= 499 or d2 >= 499 or d3 >= 499 or d4 >= 499:
          distance = {d1:'yellow', d2:'blue', d3:'black', d4:'red'}
      
          turtle.goto(-350, 290)
          turtle.write('Final result', font=('Arial', 20, 'bold'))
      
          one = max(distance.keys())
          turtle.goto(-350, 260)
          turtle.write('1:{}'.format(distance[one]), font=('Arial', 13))
          del distance[one]
      
          two = max(distance.keys())
          turtle.goto(-350, 240)
          turtle.write('2:{}'.format(distance[two]), font=('Arial', 13))
          del distance[two]
      
          three = max(distance.keys())
          turtle.goto(-350, 220)
          turtle.write('3:{}'.format(distance[three]), font=('Arial', 13))
          del distance[three]
      
          four = max(distance.keys())
          turtle.goto(-350, 200)
          turtle.write('4:{}'.format(distance[four]), font=('Arial', 13))
      
          break
      

      turtle.hideturtle()
      turtle.done()

      posted in Programming
      thilina dilshan
      thilina dilshan

    Latest posts made by thilina dilshan

    • RE: What are good technologies to learn in sri lanka

      For the web frontend development => React, Vue, angular ( React has the best job market )
      For mobile development for cross platforms => Flutter, React Native ( Not sure what will provide the best job market, but Flutter is superior )
      For backend => .NET, NodeJs, Java, Python

      posted in General Discussion
      thilina dilshan
      thilina dilshan
    • RE: How to reconnect next.js localhost

      Normal dev veda kranna nan => npm run dev
      Build krala nan =>

      1. npm run build
      2. npm start

      Apita ghnna one command eka mkkda kiyla package.json eke scripts section eken hoya ganna pluvn

      "scripts": {
      "dev": "next dev",
      "build": "next build",
      "start": "next start",
      "lint": "next lint"
      }

      posted in General Discussion
      thilina dilshan
      thilina dilshan
    • Race game using python

      import turtle
      from turtle import Turtle
      import random

      turtle.title('Turtle rance')
      turtle.bgcolor('grey')

      turtle.color('white')
      turtle.penup()
      turtle.goto(-100, 200)
      turtle.write('Turtle race', font=('Arial', 30, 'bold'))

      turtle.goto(-400, -200)
      turtle.color('brown')
      size = [800, 120, 800, 120]
      turtle.speed(100)
      turtle.begin_fill()

      for i in range(4):
      turtle.forward(size[i])
      turtle.right(90)
      turtle.end_fill()

      turtle.shape('square')
      turtle.color('dark green')
      for i in range(10):
      turtle.goto(300, 150 - (i*30))
      turtle.stamp()

      for i in range(10):
      turtle.goto(310, 140 - (i*30))
      turtle.stamp()

      t1 = Turtle()
      t1.penup()
      t1.goto(-200, 0)
      t1.shape('turtle')
      t1.color('yellow')

      t2 = Turtle()
      t2.penup()
      t2.goto(-200, 50)
      t2.shape('turtle')
      t2.color('blue')

      t3 = Turtle()
      t3.penup()
      t3.goto(-200, 100)
      t3.shape('turtle')
      t3.color('black')

      t4 = Turtle()
      t4.penup()
      t4.goto(-200, -50)
      t4.shape('turtle')
      t4.color('red')

      d1 = 0
      d2 = 0
      d3 = 0
      d4 = 0

      for i in range(200):
      ran1 = random.randint(1, 25)
      ran2 = random.randint(1, 25)
      ran3 = random.randint(1, 25)
      ran4 = random.randint(1, 25)

      t1.forward(ran1)
      d1 += ran1
      t2.forward(ran2)
      d2 += ran2
      t3.forward(ran3)
      d3 += ran3
      t4.forward(ran4)
      d4 += ran4
      
      if d1 >= 499 or d2 >= 499 or d3 >= 499 or d4 >= 499:
          distance = {d1:'yellow', d2:'blue', d3:'black', d4:'red'}
      
          turtle.goto(-350, 290)
          turtle.write('Final result', font=('Arial', 20, 'bold'))
      
          one = max(distance.keys())
          turtle.goto(-350, 260)
          turtle.write('1:{}'.format(distance[one]), font=('Arial', 13))
          del distance[one]
      
          two = max(distance.keys())
          turtle.goto(-350, 240)
          turtle.write('2:{}'.format(distance[two]), font=('Arial', 13))
          del distance[two]
      
          three = max(distance.keys())
          turtle.goto(-350, 220)
          turtle.write('3:{}'.format(distance[three]), font=('Arial', 13))
          del distance[three]
      
          four = max(distance.keys())
          turtle.goto(-350, 200)
          turtle.write('4:{}'.format(distance[four]), font=('Arial', 13))
      
          break
      

      turtle.hideturtle()
      turtle.done()

      posted in Programming
      thilina dilshan
      thilina dilshan
    • Snake Game using python(simple code)

      import random
      import curses

      s = curses.initscr()
      curses.curs_set(0)
      sh, sw = s.getmaxyx()
      w = curses.newwin(sh, sw, 0, 0)
      w.keypad(1)
      w.timeout(100)

      snk_x = sw/4
      snk_y = sh/2
      snake = [
      [snk_y, snk_x],
      [snk_y, snk_x-1],
      [snk_y, snk_x-2]
      ]

      food = [sh/2, sw/2]
      w.addch(food[0], food[1], curses.ACS_PI)

      key = curses.KEY_RIGHT

      while True:
      next_key = w.getch()
      key = key if next_key == -1 else next_key

      if snake[0][0] in [0, sh] or snake[0][1]  in [0, sw] or snake[0] in snake[1:]:
          curses.endwin()
          quit()
      
      new_head = [snake[0][0], snake[0][1]]
      
      if key == curses.KEY_DOWN:
          new_head[0] += 1
      if key == curses.KEY_UP:
          new_head[0] -= 1
      if key == curses.KEY_LEFT:
          new_head[1] -= 1
      if key == curses.KEY_RIGHT:
          new_head[1] += 1
      
      snake.insert(0, new_head)
      
      if snake[0] == food:
          food = None
          while food is None:
              nf = [
                  random.randint(1, sh-1),
                  random.randint(1, sw-1)
              ]
              food = nf if nf not in snake else None
          w.addch(food[0], food[1], curses.ACS_PI)
      else:
          tail = snake.pop()
          w.addch(tail[0], tail[1], ' ')
      
      w.addch(snake[0][0], snake[0][1], curses.ACS_CKBOARD)
      

      Windows walata curses eka support karan nethi nisa ModuleError ekk enava.
      Ekata pip install windows-curses karala balanna.

      Linux vala nan ehema prashnayak naha.

      posted in Programming
      thilina dilshan
      thilina dilshan
    • RE: Python BirthDay Reminder(Simple code)

      @dev_lak issarahata balamu machn....

      posted in Programming
      thilina dilshan
      thilina dilshan
    • Python BirthDay Reminder(Simple code)

      dicts = {}

      while True:
      print("...Birth Day App...\n")
      print("1.Show Birth Days")
      print("2.Add Birth Days")
      print("3.Exit\n")

      choice = int(input("What is your choice:"))
      if choice == 1:
          if len(dicts.keys()) == 0:
              print("No Birth Days yet..\n")
          else:
              name = input("Enter friend's name:")
              birth_day = dicts.get(name, "No data found")
              print(birth_day,'\n')
      
      elif choice == 2:
          name = input("Enter name:")
          birth_day = input("Enter birth Day:")
          dicts[name] = birth_day
          print("Data Added\n")
      
      elif choice == 3:
          print("Thanks for using birth Day reminder app..")
          break
      else:
          print("Choose a valid option...\n")
      
      posted in Programming
      thilina dilshan
      thilina dilshan