Luiginico

CCraft BlackJack

Jan 29th, 2013
1,861
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --BlackJack by Luiginico
  2.  
  3. --@ = Spades, # = Hearts, + = Clubs, O = Diamonds
  4.  
  5. --Variables
  6. --Cards created by Bej --> http://ascii.co.uk/art/cards
  7.  
  8. deck = { {" _________ ","|A        |", "|@   *    |", "|   / \\   |", "|  /_@_\\  |", "|    !    |", "|   ~ ~  @|", "|        V|", " ~~~~~~~~~ ", "A@", 11    }, --A@
  9.          {" _________ ", "|2        |", "|@        |", "|    @    |", "|         |", "|    @    |", "|        @|", "|        Z|", " ~~~~~~~~~ ", "2@", 2     }, --2@
  10.          {" _________ ", "|3        |", "|@   @    |", "|         |", "|    @    |", "|         |", "|    @   @|", "|        E|", " ~~~~~~~~~ ", "3@", 3     }, --3@
  11.          {" _________ ", "|4        |", "|@        |", "|  @   @  |", "|         |", "|  @   @  |", "|        @|", "|        b|", " ~~~~~~~~~ ", "4@", 4     }, --4@
  12.          {" _________ ", "|5        |", "|@        |", "|  @   @  |", "|    @    |", "|  @   @  |", "|        @|", "|        S|", " ~~~~~~~~~ ", "5@", 5     }, --5@
  13.          {" _________ ", "|6        |", "|@ @   @  |", "|         |", "|  @   @  |", "|         |", "|  @   @ @|", "|        9|", " ~~~~~~~~~ ", "6@", 6     }, --6@
  14.          {" _________ ", "|7        |", "|@ @   @  |", "|    @    |", "|  @   @  |", "|         |", "|  @   @ @|", "|        L|", " ~~~~~~~~~ ", "7@", 7     }, --7@
  15.          {" _________ ", "|8 @   @  |", "|@        |", "|  @   @  |", "|         |", "|  @   @  |", "|        @|", "|  @   @ 8|", " ~~~~~~~~~ ", "8@", 8     }, --8@
  16.          {" _________ ", "|9 @   @  |", "|@        |", "|  @   @  |", "|    @    |", "|  @   @  |", "|        @|", "|  @   @ 6|", " ~~~~~~~~~ ", "9@", 9     }, --9@
  17.          {" _________ ", "|10@   @  |", "|@   @    |", "|  @   @  |", "|         |", "|  @   @  |", "|    @   @|", "|  @   @0l|", " ~~~~~~~~~ ", "10@", 10     }, --10@
  18.          {" _________ ", "|J /~~|_  |", "|@ ! -\\   |", "|  \\ -!   |", "|  ',\\',  |", "|   I- \\  |", "|   \\- I @|", "|  ~|__/ P|", " ~~~~~~~~~ ", "J@", 10}, --J@
  19.          {" _________ ", "|Q |~~~|  |", "|@ \\- -/  |", "| o |-|   |", "|  I % I  |", "|   |-| o |", "|  /- -\\ @|", "|  |___| Q|", " ~~~~~~~~~ ", "Q@", 10   }, --Q@
  20.          {" _________ ", "|K |/|\\|  |", "|@ \\- -/  |", "| ! |-|   |", "|  % I %  |", "|   |-| ! |", "|  /- -\\ @|", "|  |\\|/| X|", " ~~~~~~~~~ ", "K@", 10 }, --K@
  21.          {" _________ ", "|A        |", "|# _   _  |", "| / ~V~ \\ |", "| \\ Bej / |", "|  \\ # /  |", "|   '.'  #|", "|        V|", " ~~~~~~~~~ ", "A#", 11  }, --A#
  22.          {" _________ ", "|2        |", "|#        |", "|    #    |", "|         |", "|    #    |", "|        #|", "|        Z|", " ~~~~~~~~~ ", "2#", 2},   --2#
  23.          {" _________ ", "|3        |", "|#   #    |", "|         |", "|    #    |", "|         |", "|    #   #|", "|        E|", " ~~~~~~~~~ ", "3#", 3},   --3#
  24.          {" _________ ", "|4        |", "|#        |", "|  #   #  |", "|         |", "|  #   #  |", "|        #|", "|        b|", " ~~~~~~~~~ ", "4#", 4},   --4#
  25.          {" _________ ", "|5        |", "|#        |", "|  #   #  |", "|    #    |", "|  #   #  |", "|        #|", "|        S|", " ~~~~~~~~~ ", "5#", 5},   --5#
  26.          {" _________ ", "|6        |", "|# #   #  |", "|         |", "|  #   #  |", "|         |", "|  #   # #|", "|        9|", " ~~~~~~~~~ ", "6#", 6},   --6#
  27.          {" _________ ", "|7        |", "|# #   #  |", "|    #    |", "|  #   #  |", "|         |", "|  #   # #|", "|        L|", " ~~~~~~~~~ ", "7#", 7},   --7#
  28.          {" _________ ", "|8 #   #  |", "|#        |", "|  #   #  |", "|         |", "|  #   #  |", "|        #|", "|  #   # 8|", " ~~~~~~~~~ ", "8#", 8},   --8#
  29.          {" _________ ", "|9 #   #  |", "|#        |", "|  #   #  |", "|    #    |", "|  #   #  |", "|        #|", "|  #   # 6|", " ~~~~~~~~~ ", "9#", 9},   --9#
  30.          {" _________ ", "|10#   #  |", "|#   #    |", "|  #   #  |", "|         |", "|  #   #  |", "|    #   #|", "|  #   #0l|", " ~~~~~~~~~ ", "10#", 10},   --10#
  31.          {" _________ ", "|J /~~|_  |", "|# % *'.  |", "|  % <~   |", "| %% / %% |", "|   _> %  |", "|  ',* % #|", "|  ~|__/ P|", " ~~~~~~~~~ ", "J#", 10},   --J#
  32.          {" _________ ", "|Q |~~~|  |", "|# %*,*%  |", "|  \\_o_/  |", "| -=<*>=- |", "|  /~o~\\  |", "|  %*'*% #|", "|  |___| Q|", " ~~~~~~~~~ ", "Q#", 10}, --Q#
  33.          {" _________ ", "|K |/|\\|  |", "|# %*,*%  |", "|  \\_o_/  |", "| #>-=-<# |", "|  /~o~\\  |", "|  %*'*% #|", "|  |\\|/| X|", " ~~~~~~~~~ ", "K#", 10},--K#
  34.          {" _________ ", "|A        |", "|+   *    |", "|    !    |", "|  *-+-*  |", "|    |    |", "|   ~~~  +|", "|        V|", " ~~~~~~~~~ ", "A+", 11},  --A+
  35.          {" _________ ", "|2        |", "|+        |", "|    +    |", "|         |", "|    +    |", "|        +|", "|        Z|", " ~~~~~~~~~ ", "2+", 2},   --2+
  36.          {" _________ ", "|3        |", "|+   +    |", "|         |", "|    +    |", "|         |", "|    +   +|", "|        E|", " ~~~~~~~~~ ", "3+", 3},   --3+
  37.          {" _________ ", "|4        |", "|+        |", "|  +   +  |", "|         |", "|  +   +  |", "|        +|", "|        b|", " ~~~~~~~~~ ", "4+", 4},   --4+
  38.          {" _________ ", "|5        |", "|+        |", "|  +   +  |", "|    +    |", "|  +   +  |", "|        +|", "|        S|", " ~~~~~~~~~ ", "5+", 5},   --5+
  39.          {" _________ ", "|6        |", "|+ +   +  |", "|         |", "|  +   +  |", "|         |", "|  +   + +|", "|        9|", " ~~~~~~~~~ ", "6+", 6},   --6+
  40.          {" _________ ", "|7        |", "|+ +   +  |", "|    +    |", "|  +   +  |", "|         |", "|  +   + +|", "|        L|", " ~~~~~~~~~ ", "7+", 7},   --7+
  41.          {" _________ ", "|8 +   +  |", "|+        |", "|  +   +  |", "|         |", "|  +   +  |", "|        +|", "|  +   + 8|", " ~~~~~~~~~ ", "8+", 8},   --8+
  42.          {" _________ ", "|9 +   +  |", "|+        |", "|  +   +  |", "|    +    |", "|  +   +  |", "|        +|", "|  +   + 6|", " ~~~~~~~~~ ", "9+", 9},   --9+
  43.          {" _________ ", "|10+   +  |", "|+   +    |", "|  +   +  |", "|         |", "|  +   +  |", "|    +   +|", "|  +   +0l|", " ~~~~~~~~~ ", "10+", 10},   --10+
  44.          {" _________ ", "|J /~~|_  |", "|+ | o',  |", "|  | -|   |", "| =~)+(_= |", "|   |- |  |", "|  '.o | +|", "|  ~|__/ P|", " ~~~~~~~~~ ", "J+", 10},   --J+
  45.          {" _________ ", "|Q |~~~|  |", "|+ /o,o\\  |", "|  \\_-_/  |", "| _-~+_-~ |", "|  /~-~\\  |", "|  \\o'o/ +|", "|  |___| Q|", " ~~~~~~~~~ ", "Q#", 10}, --Q+
  46.          {" _________ ", "|K |/|\\|  |", "|+ /o,o\\  |", "|  \\_-_/  |", "| ~-_-~-_ |", "|  /~-~\\  |", "|  \\o'o/ +|", "|  |\\|/| X|", " ~~~~~~~~~ ", "K+", 10},--K+
  47.          {" _________ ", "|A        |", "|O  /~\\   |", "|  / ^ \\  |", "| |  )  | |", "|  \\ v /  |", "|   \\_/  O|", "|        V|", " ~~~~~~~~~ ", "AO", 11},  --AO
  48.          {" _________ ", "|2        |", "|O        |", "|    O    |", "|         |", "|    O    |", "|        O|", "|        Z|", " ~~~~~~~~~ ", "2O", 2},   --2O
  49.          {" _________ ", "|3        |", "|O   O    |", "|         |", "|    O    |", "|         |", "|    O   O|", "|        E|", " ~~~~~~~~~ ", "3O", 3},   --3O
  50.          {" _________ ", "|4        |", "|O        |", "|  O   O  |", "|         |", "|  O   O  |", "|        O|", "|        b|", " ~~~~~~~~~ ", "4O", 4},   --4O
  51.          {" _________ ", "|5        |", "|O        |", "|  O   O  |", "|    O    |", "|  O   O  |", "|        O|", "|        S|", " ~~~~~~~~~ ", "5O", 5},   --5O
  52.          {" _________ ", "|6        |", "|O O   O  |", "|         |", "|  O   O  |", "|         |", "|  O   O O|", "|        9|", " ~~~~~~~~~ ", "6O", 6},   --6O
  53.          {" _________ ", "|7        |", "|O O   O  |", "|    O    |", "|  O   O  |", "|         |", "|  O   O O|", "|        L|", " ~~~~~~~~~ ", "7O", 7},   --7O
  54.          {" _________ ", "|8 O   O  |", "|O        |", "|  O   O  |", "|         |", "|  O   O  |", "|        O|", "|  O   O 8|", " ~~~~~~~~~ ", "8O", 8},   --8O
  55.          {" _________ ", "|9 O   O  |", "|O        |", "|  O   O  |", "|    O    |", "|  O   O  |", "|        O|", "|  O   O 6|", " ~~~~~~~~~ ", "9O", 9},   --9O
  56.          {" _________ ", "|10O   O  |", "|O   O    |", "|  O   O  |", "|         |", "|  O   O  |", "|    O   O|", "|  O   O0l|", " ~~~~~~~~~ ", "10O", 10},   --10O
  57.          {" _________ ", "|J /~~|_  |", "|O ( o\\   |", "|  ! \\l   |", "| ^^^Xvvv |", "|   l\\ I  |", "|   \\o ) O|", "|  ~|__/ P|", " ~~~~~~~~~ ", "JO", 10},   --JO
  58.          {" _________ ", "|Q |~~~|  |", "|O |o.o|  |", "|   \\v/   |", "|  XXOXX  |", "|   /^\\   |", "|  |o'o| O|", "|  |___| Q|", " ~~~~~~~~~ ", "QO", 10}, --QO
  59.          {" _________ ", "|K |/|\\|  |", "|O |o.o|  |", "|   \\v/   |", "|  XXXXX  |", "|   /^\\   |", "|  |o'o| O|", "|  |\\|/| X|", " ~~~~~~~~~ ", "KO", 10}--KO
  60. }
  61.  
  62. imgCardStop = 9
  63. codeCard = 10
  64. valueCard = 11
  65.  
  66. x, y = term.getSize()
  67.  
  68. --Functions
  69. function reset()
  70.     myPoints = 0
  71.     DPoints = 0
  72.     DPointsReal = 0
  73.  
  74.     myAceCount = 0
  75.     DAceCount = 0
  76.  
  77.     faceDown = 0
  78.  
  79.     myCards = { }
  80.     myCardsN = 0
  81.  
  82.     cardsDrawn = 0
  83.  
  84.     BlackJack = false
  85.     DBlackJack = false
  86.    
  87.     messages = { }
  88.     blank = " "
  89.     for i=2,x-2 do
  90.         blank = blank.. " "
  91.     end
  92.     for i=12,y-2 do
  93.         messages[i-11] = blank
  94.     end
  95.    
  96.     firstTurn = true
  97. end
  98.  
  99. function shuffle(t)
  100. --http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
  101.     local n = #t
  102.  
  103.     while n >= 2 do
  104.         local k = math.random(n)
  105.         t[n], t[k] = t[k], t[n]
  106.         n = n - 1
  107.     end
  108.  
  109.     return t
  110. end
  111.  
  112. function clear()
  113.     term.clear()
  114.     term.setCursorPos(1,1)
  115. end
  116.  
  117. function drawScreen()
  118.     clear()
  119.     write("+")
  120.     for i=1,x-2 do
  121.         write("-")
  122.     end
  123.     write("+")
  124.     for j=2,y-1 do
  125.         write("|")
  126.         for i=1,x-2 do
  127.             write(" ")
  128.         end
  129.         write("|")
  130.     end
  131.     write("+")
  132.     for i=1,x-2 do
  133.         write("-")
  134.     end
  135.     write("+")
  136.     term.setCursorPos(x/2-15, y-1)
  137.     write("CCraft BlackJack, By Luiginico")
  138. end
  139.  
  140. function tutorialScreen()
  141.     drawScreen()
  142.     term.setCursorPos(x/2-10,2)
  143.     write("How to play BlackJack")
  144.     term.setCursorPos(2, 4)
  145.     write("The object of the game is to reach more points")
  146.     term.setCursorPos(2, 5)
  147.     write("than the Dealer without exceding 21")
  148.     term.setCursorPos(2, 6)
  149.     write("Each player will start the game with 2 cards")
  150.     term.setCursorPos(2, 7)
  151.     write("Then you count the points of your cards:")
  152.     term.setCursorPos(2, 8)
  153.     write("o Cards from 2-10 = 2-10 points")
  154.     term.setCursorPos(2, 9)
  155.     write("o J, Q, K = 10 points each")
  156.     term.setCursorPos(2, 10)
  157.     write("o Aces = 11 or 1 points")
  158.     term.setCursorPos(2, 11)
  159.     write("If you have exactly 21 points you made")
  160.     term.setCursorPos(2, 12)
  161.     write("BlackJack and you have won!")
  162.     term.setCursorPos(2, 13)
  163.     write("Exept if the Dealer made BlackJack too")
  164.     term.setCursorPos(x/2-12, 15)
  165.     write("Press any key to continue")
  166.     sleep(.1)
  167.     os.pullEventRaw()
  168.     drawScreen()
  169.     term.setCursorPos(x/2-7,2)
  170.     write("A regular turn")
  171.     term.setCursorPos(2, 4)
  172.     write("During your turn you can choose to:")
  173.     term.setCursorPos(2, 5)
  174.     write("o Call for another card:")
  175.     term.setCursorPos(2, 6)
  176.     write("You will get a new card and all its points")
  177.     term.setCursorPos(2, 7)
  178.     write("Is the only way to get points")
  179.     term.setCursorPos(2, 8)
  180.     write("but you could go over 21 pretty easly")
  181.     term.setCursorPos(2, 9)
  182.     write("o Stop:")
  183.     term.setCursorPos(2, 10)
  184.     write("You finish your turn with the points you have")
  185.     term.setCursorPos(x/2-12, 12)
  186.     write("Press any key to continue")
  187.     sleep(.1)
  188.     os.pullEventRaw()
  189.     drawScreen()
  190.     term.setCursorPos(x/2-9,2)
  191.     write("Winnigs and Losings")
  192.     term.setCursorPos(2, 4)
  193.     write("At the end of the Dealer turns all the players")
  194.     term.setCursorPos(2, 5)
  195.     write("who have more points than the Dealer and less")
  196.     term.setCursorPos(2, 6)
  197.     write("than 22 points will win")
  198.     term.setCursorPos(2, 7)
  199.     write("People play against the Dealer and not against")
  200.     term.setCursorPos(2, 8)
  201.     write("each others")
  202.     term.setCursorPos(x/2-12, 10)
  203.     write("Press any key to continue")
  204.     sleep(.1)
  205.     os.pullEventRaw()
  206.     return loginScreen()
  207. end
  208.  
  209. function loginGUI()
  210.     while true do
  211.         local event, p1, p2, p3 = os.pullEventRaw()
  212.         if event == "char" then
  213.             if p1 == "n" then
  214.                 return true
  215.             elseif p1 == "e" then
  216.                 return false
  217.             elseif p1 == "h" then
  218.                 return tutorialScreen()
  219.             end
  220.         elseif event == "mouse_click" or event == "monitor_touch" then
  221.             if p3 == 3 then
  222.                 return true
  223.             elseif p3 == 5 then
  224.                 return false
  225.             elseif p3 == 7 then
  226.                 return tutorialScreen()
  227.             end
  228.         end
  229.     end
  230. end
  231.  
  232.  
  233.  
  234. function loginScreen()
  235.     drawScreen()
  236.     term.setCursorPos(x/2-4, 3)
  237.     write("New game")
  238.     term.setCursorPos(x/2-2, 5)
  239.     write("Exit")
  240.     term.setCursorPos(x/2-5, 7)
  241.     write("How to play")
  242.     term.setCursorPos(2, y-3)
  243.     write("Click or press the first letter to choose")
  244.     if loginGUI() then
  245.         return true
  246.     else
  247.         return false
  248.     end
  249. end
  250.  
  251. function gameScreen()
  252.     drawScreen()
  253.     term.setCursorPos(x/2-5, 11)
  254.     write("More   Stop")
  255.     update()
  256. end
  257.  
  258. function userlog(message)
  259.     for count=1,#messages-1 do
  260.         messages[#messages-count+1] = messages[#messages-count]
  261.     end
  262.     messages[1] = message
  263.     for count=1,#messages do
  264.         term.setCursorPos(2, 11+count)
  265.         write(blank)
  266.         term.setCursorPos(2, 11+count)
  267.         write(messages[count])
  268.     end
  269.     sleep(1)
  270. end
  271.  
  272. function update()
  273.     term.setCursorPos(2, 11)
  274.     if myPoints > 21 then
  275.         if myAceCount > 0 then
  276.             myAceCount = myAceCount - 1
  277.             myPoints = myPoints - 10
  278.             update()
  279.         else
  280.             write("You: XX")
  281.         end
  282.     else
  283.         write("You: " ..myPoints)
  284.     end
  285.     term.setCursorPos(x-11, 11)
  286.     if DPoints > 21 then
  287.         if DAceCount > 0 then
  288.             DAceCount = DAceCount - 1
  289.             DPoints = DPoints - 10
  290.             update()
  291.         else
  292.             write("Dealer: XX")
  293.         end
  294.     else
  295.         write("Dealer: " ..DPoints)
  296.     end
  297. end
  298.  
  299. function printCards(toPrint)
  300.     for i=1,#toPrint do
  301.         for j=1,imgCardStop do
  302.             term.setCursorPos(2+5*(i-1), 1+j)
  303.             write(deck[toPrint[i]][j])
  304.         end
  305.     end
  306. end
  307.  
  308. function givePlayer(card)
  309.     myPoints = myPoints + deck[card][valueCard]
  310.     if deck[card][valueCard] == 11 then
  311.         myAceCount = myAceCount + 1
  312.     end
  313.     userlog("You recieved a " ..deck[card][codeCard])
  314.     myCardsN = myCardsN + 1
  315.     myCards[myCardsN] = card
  316.     printCards(myCards)
  317.     update()
  318. end
  319.  
  320. function giveDealerFaceDown(card)
  321.     DPointsReal = DPointsReal + deck[card][valueCard]
  322.     if deck[card][valueCard] == 11 then
  323.         DAceCount = DAceCount + 1
  324.     end
  325.     userlog("The Dealer received a face-down card")
  326.     faceDown = card
  327. end
  328.  
  329. function giveDealer(card)
  330.     DPointsReal = DPointsReal + deck[card][valueCard]
  331.     if deck[card][valueCard] == 11 then
  332.         DAceCount = DAceCount + 1
  333.     end
  334.     DPoints = DPoints + deck[card][valueCard]
  335.     userlog("The Dealer received a " ..deck[card][codeCard])
  336.     update()
  337. end
  338.  
  339. function drawCard()
  340.     cardsDrawn = cardsDrawn + 1
  341.     if cardsDrawn == 53 then
  342.         userlog("No more cards, the deck will be reshuffled")
  343.         deck = shuffle(deck)
  344.         cardsDrawn = 1
  345.     end
  346.     return cardsDrawn
  347. end
  348.  
  349. function deal()
  350.     givePlayer(drawCard())
  351.     giveDealerFaceDown(drawCard())
  352.     givePlayer(drawCard())
  353.     giveDealer(drawCard())
  354.     if myPoints == 21 then
  355.         userlog("BlackJack")
  356.         BlackJack = true
  357.     end
  358. end
  359.  
  360. function turn()
  361.     if myPoints < 21 then
  362.         userlog("Is your turn")
  363.         if firstTurn then  
  364.             firstTurn = false
  365.         end
  366.         while true do
  367.             local event, p1, p2, p3 = os.pullEventRaw()
  368.             if event == "char" then
  369.                 if p1 == "m" then
  370.                     givePlayer(drawCard())
  371.                     return true
  372.                 elseif p1 == "s" then
  373.                     userlog("You stopped")
  374.                     return false
  375.                 end
  376.             elseif event == "mouse_click" or event == "monitor_touch" then
  377.                 if p2 >= (x/2-5) and p2 <= (x/2-2) then
  378.                     givePlayer(drawCard())
  379.                     return true
  380.                 elseif p2 >= (x/2+1) and p2 <= (x/2+4) then
  381.                     userlog("You stopped")
  382.                     return false
  383.                 end
  384.             end
  385.         end
  386.     elseif myPoints > 21 then
  387.         if not(BlackJack) then
  388.             userlog("Your total is greater than 21, you are out")
  389.         end
  390.         return false
  391.     else
  392.         userlog("Your total is 21, you have to stop")
  393.         return false
  394.     end
  395. end
  396.  
  397. function reveal()
  398.     userlog("The Dealer reveal the face down card")
  399.     userlog("It's a " ..deck[faceDown][codeCard])
  400.     DPoints = DPointsReal
  401.     if DPoints == 21 then
  402.         userlog("The dealer made BlackJack")
  403.         DBlackJack = true
  404.     end
  405.     update()
  406. end
  407.  
  408. function DTurn()
  409.     if DPoints <= 15 then
  410.         giveDealer(drawCard())
  411.         return true
  412.     elseif DPoints >= 16 and DPoints <= 21 then
  413.         if not(DBlackJack) then
  414.             userlog("The Dealer stopped")
  415.             return false
  416.         end
  417.     elseif DPoints > 21 then
  418.         userlog("The Dealer total is greater than 21, he is out")
  419.         return false
  420.     end
  421. end
  422.  
  423. function winners()
  424.     if DBlackJack or (DPoints <= 21 and myPoints <= 21 and DPoints >= myPoints) or myPoints > 21 then
  425.         userlog("You have lost")
  426.     else
  427.         userlog("You have won")
  428.     end
  429.     userlog("Press a key to continue")
  430. end
  431.  
  432. function mainGame()
  433.     gameScreen()
  434.     deck = shuffle(deck)
  435.     deal()
  436.     if not(BlackJack) then
  437.         while turn() do end
  438.     end
  439.     userlog("Is the Dealer turn")
  440.     reveal()
  441.     if not(DBlackJack) then
  442.         while DTurn() do end
  443.     end
  444.     winners()
  445. end
  446.  
  447. --Main
  448. while loginScreen() do
  449.     reset()
  450.     mainGame()
  451.     os.pullEventRaw()
  452. end
  453. term.clear()
  454. term.setCursorPos(1,1)
Advertisement
Add Comment
Please, Sign In to add comment