Yo, Yo, Yo.

Discussion in 'Taylor's Tittle-Tattle - General Banter' started by cyaninternetdog, Apr 15, 2023.

  1. cyaninternetdog

    cyaninternetdog Forum Hippie

    Joined:
    Feb 7, 2007
    Messages:
    15,722
    Likes Received:
    3,345
    Trophy Points:
    113
    Location:
    Tyne And Wear
    Am I stuck here with you or are you stuck here with me? The writing is on the wall, it always has been, its just we couldnt see it until now. All is illusion, all is false. Just look at the human body and the way we reproduce, someone is having a good laugh I feel or it's AI. We really should have a deep thought section or as deep as we can "think". Let it be so, output is input once recieved and understood.

    // Declare a function for the chatbot AI
    function ChatBotAI() {
    // Define a variable to keep track of the user's previous message
    var lastMessage = "";

    // Begin infinite loop to continuously chat with the user
    while (true) {
    // Prompt the user to enter a message
    var message = prompt("What would you like to say?");

    // Break out of the loop if the user enters nothing
    if (message === "") {
    break;
    }

    // Print out the user's message
    console.log("You said: " + message);

    // If the user's message is the same as last time, reply with a funny response
    if (message === lastMessage) {
    console.log("Come on, think of something new to say!");
    }
    else {
    // Otherwise, provide a response based on the user's message
    console.log("That's a good message!");
    }

    // Update the message tracker
    lastMessage = message; for i in range(1, 5):
    print("I'm on iteration " + str(i))

    print("Loop ended")
     
    SkylaRose likes this.
  2. WillisWasTheWorst

    WillisWasTheWorst Its making less grammar mistake's thats important

    Joined:
    May 14, 2017
    Messages:
    8,885
    Likes Received:
    8,290
    Trophy Points:
    113
    Gender:
    Male
    received
     
    cyaninternetdog likes this.
  3. SkylaRose

    SkylaRose Administrator

    Staff Member
    Joined:
    Oct 11, 2014
    Messages:
    11,517
    Likes Received:
    8,706
    Trophy Points:
    113
    Gender:
    Female
    Location:
    Under the stars
    JavaScript.... the most beloved scripting language.

    Did you write that yourself?
     
  4. Keighley

    Keighley First Team

    Joined:
    Nov 5, 2016
    Messages:
    15,483
    Likes Received:
    10,829
    Trophy Points:
    113
    Location:
    Bristol
    I have literally no idea what is going on.
     
  5. UEA_Hornet

    UEA_Hornet First Team Captain

    Joined:
    Nov 7, 2006
    Messages:
    69,452
    Likes Received:
    25,974
    Trophy Points:
    113
    Location:
    The Midlands
    Gino Pozzo, is that you?
     
    SkylaRose and Keighley like this.
  6. SkylaRose

    SkylaRose Administrator

    Staff Member
    Joined:
    Oct 11, 2014
    Messages:
    11,517
    Likes Received:
    8,706
    Trophy Points:
    113
    Gender:
    Female
    Location:
    Under the stars
    Cat is out of the bag now Keighley... :p
     
  7. Horace_goes_up_north

    Horace_goes_up_north Reservist

    Joined:
    Sep 13, 2018
    Messages:
    2,986
    Likes Received:
    2,245
    Trophy Points:
    113
  8. The undeniable truth

    The undeniable truth First Team Captain

    Joined:
    Jun 26, 2014
    Messages:
    34,849
    Likes Received:
    20,550
    Trophy Points:
    113
    Location:
    over here
    We are a yo yo yo club.
     
  9. SkylaRose

    SkylaRose Administrator

    Staff Member
    Joined:
    Oct 11, 2014
    Messages:
    11,517
    Likes Received:
    8,706
    Trophy Points:
    113
    Gender:
    Female
    Location:
    Under the stars
     
  10. Ilkley

    Ilkley Formerly known as An Ilkley Orn Baht 'at

    Joined:
    Apr 29, 2022
    Messages:
    821
    Likes Received:
    957
    Trophy Points:
    93
    Gender:
    Male
    Location:
    Near Ilkley Moor
    42
     
  11. SkylaRose

    SkylaRose Administrator

    Staff Member
    Joined:
    Oct 11, 2014
    Messages:
    11,517
    Likes Received:
    8,706
    Trophy Points:
    113
    Gender:
    Female
    Location:
    Under the stars
    Code:
     --
    -- plots points on a graph then prints the output to screen
    -- Rose, Skyla
    -- April '23
    -- Compiles Under: GCC 3.0 GNAT 2023
    -- 
    with Ada.Text_IO; use Ada.Text_IO;
    with Ada.Characters; use Ada.Characters;
    with Ada.Integer_Text_IO; use Ada.Integer_Text_IO;
    with Ada.Strings; use Ada.Strings;
    
    -- procedure main - begins program execution
    procedure main is
       type Sketch_Pad is array(1 .. 50, 1 .. 50) of Character;
       thePen : Boolean := True; -- pen raised by default
       sketch : Sketch_Pad;
       ycorr, xcorr : Integer := 25;
    
       -- specifications
       function penPosition(thePen : in out Boolean) return String;
       procedure initGrid(sketch : in out Sketch_Pad);
       procedure commandMenu(thePen : in out Boolean; xcorr : in out Integer;
                             ycorr : in out Integer);
       procedure showMenu(xcorr : in out Integer; ycorr : in out Integer;
                          thePen : in out Boolean; sketch : in Sketch_Pad);
       procedure moveCursor(thePen : in Boolean; sketch : in out Sketch_Pad;
                            xcorr : in out Integer; ycorr : in out Integer;
                            ch : in Integer);
       procedure showGrid(sketch : in Sketch_Pad);
    
       -- procedure initGrid - creates the sketchpad and initializes elements
       procedure initGrid(sketch : in out Sketch_Pad) is
       begin
           sketch := (others => (others => ' '));
       end initGrid;
    
       -- procedure showMenu - displays the menu for the application
       procedure showMenu(xcorr : in out Integer; ycorr : in out Integer;
                          thePen : in out Boolean; sketch : in Sketch_Pad) is
    
           choice : Integer := 0;
       begin
           while choice /= 4 loop
               Set_Col(15);
               Put("TURTLE GRAPHICS APPLICATION");
               Set_Col(15);
               Put("===========================");
               New_Line(2);
    
               Put_Line("Enter 1 to print the grid map");
               Put_Line("Enter 2 for command menu");
               Put_Line("Enter 3 to raise pen up / down");
               Put_Line("Enter 4 to exit the application");
               choice := integer'value(Get_Line);
    
               exit when choice = 4;
    
               case choice is
                   when 1 => showGrid(sketch);
                   when 2 => commandMenu(thePen, xcorr, ycorr);
                   when 3 => Put_Line("Pen is "
                                 & penPosition(thePen));
                   when others => Put_Line("Invalid input");
               end case;
           end loop;
       end showMenu;
    
       -- function penPosition - checks changes the state of whether the pen is
       -- raised up or down. If value is True, pen is rasied up
       function penPosition(thePen : in out Boolean) return String is
           str1 : constant String := "raised UP";
           str2 : constant String := "raised DOWN";
       begin
           if thePen = True then
               thePen := False;
               return str2;
           else
               thePen := True;
           end if;
    
           return str1;
       end penPosition;
    
       -- procedure command menu - provides a list of directions for the turtle
       -- to move along the grid
       procedure commandMenu(thePen : in out Boolean; xcorr : in out Integer;
                             ycorr : in  out Integer) is
    
           choice : Integer := 0;
       begin
           while choice <= 0 or choice > 5 loop
               Set_Col(15);
               Put("Command Menu");
               Set_Col(15);
               Put("============");
               New_Line(2);
    
               Put_Line("To move North enter 1");
               Put_Line("To move South enter 2");
               Put_Line("To move East enter 3");
               Put_Line("To move West enter 4");
               Put_Line("To return to previous menu enter 5");
               choice := integer'value(Get_Line);
    
               case choice is
                   when 1 => moveCursor(thePen, sketch, xcorr, ycorr, choice);
                   when 2 => moveCursor(thePen, sketch, xcorr, ycorr, choice);
                   when 3 => moveCursor(thePen, sketch, xcorr, ycorr, choice);
                   when 4 => moveCursor(thePen, sketch, xcorr, ycorr, choice);
                   when 5 => showMenu(xcorr, ycorr, thePen, sketch);
                   when others => Put_Line("Invalid choice");
               end case;
           end loop;
       end commandMenu;
    
    
       -- procedure moveCursor - moves the cursor around the board by taking the
       -- x and y coordinates from the user. If the pen is down, a character is
       -- printed at that location. If the pen is up, nothing is printed but the
       -- cursor still moves to that position
       procedure moveCursor(thePen : in Boolean; sketch : in out Sketch_Pad;
                            xcorr : in out Integer; ycorr : in out Integer;
                            ch : in Integer) is
    
       begin
           if thePen = True then -- pen up so move cursor but do not draw
               case ch is
                   when 1 => xcorr := xcorr - 1; ycorr := ycorr;
                       sketch(xcorr, ycorr) := ' ';
                   when 2 => xcorr := xcorr + 1; ycorr := ycorr;
                       sketch(xcorr, ycorr) := ' ';
                   when 3 => xcorr := xcorr; ycorr := ycorr + 1;
                       sketch(xcorr, ycorr) := ' ';
                   when 4 => xcorr := xcorr; ycorr := ycorr - 1;
                       sketch(xcorr, ycorr) := ' ';
                   when others => Put("Unreachable Code");
               end case;
    
           else -- pen is down so move cursor and draw
               case ch is
                   when 1 => xcorr := xcorr - 1; ycorr := ycorr;
                       sketch(xcorr, ycorr) := '#';
                   when 2 => xcorr := xcorr + 1; ycorr := ycorr;
                       sketch(xcorr, ycorr) := '#';
                   when 3 => xcorr := xcorr; ycorr := ycorr + 1;
                       sketch(xcorr, ycorr) := '#';
                   when 4 => xcorr := xcorr; ycorr := ycorr - 1;
                       sketch(xcorr, ycorr) := '#';
                   when others => Put("Unreachable Code");
               end case;
           end if;
       end moveCursor;
    
       -- procedure showGrid - prints the sketchpad showing the plotted moves
       procedure showGrid(sketch : in Sketch_Pad) is
       begin
           New_Line;
    
           for I in sketch'Range(1) loop
               for J in sketch'Range(2) loop
                   Put(character'image(sketch(I,J)));
               end loop;
               New_Line;
           end loop;
           New_Line;
       end showGrid;
    
    begin
       New_Line;
    
       initGrid(sketch);
       showMenu(xcorr, ycorr, thePen, sketch);
    
       New_Line;
    end main;
     
  12. The undeniable truth

    The undeniable truth First Team Captain

    Joined:
    Jun 26, 2014
    Messages:
    34,849
    Likes Received:
    20,550
    Trophy Points:
    113
    Location:
    over here
    Worrying if true.
     
  13. SkylaRose

    SkylaRose Administrator

    Staff Member
    Joined:
    Oct 11, 2014
    Messages:
    11,517
    Likes Received:
    8,706
    Trophy Points:
    113
    Gender:
    Female
    Location:
    Under the stars
    It's a basic plot and move application. Coordinates entered correspond to the X Y corrs of the grid. For example, if a person entered:

    1
    1
    1
    1
    3
    3
    3
    3
    8
    8
    8
    8
    8
    8
    8


    The output would be:

    ########
    '''''''''''#
    '''''''''''#
    ''''''''''#
     
  14. Ilkley

    Ilkley Formerly known as An Ilkley Orn Baht 'at

    Joined:
    Apr 29, 2022
    Messages:
    821
    Likes Received:
    957
    Trophy Points:
    93
    Gender:
    Male
    Location:
    Near Ilkley Moor
    I’m impressed.
    I’m sure there are no errors in your code, but if there are, I dare say @Keighley will point them out.
     
  15. SkylaRose

    SkylaRose Administrator

    Staff Member
    Joined:
    Oct 11, 2014
    Messages:
    11,517
    Likes Received:
    8,706
    Trophy Points:
    113
    Gender:
    Female
    Location:
    Under the stars
    Code:
    -----build output GNAT 3.0 (pro edition)----
    e:/cd/user/skyla/documents/projects/adaprojs/plotpath/src/
    gcc -c -wall -g main.adb
    [ada]compiling....  done.
    0 errors 1 warning 0 other
    -wall[gcc 3.0][ada]message: external linker cannot find binder, building from system specifications
    generating debug output...  done.
    generating .obj file...  done.
    binding...  done.
    Linking... done.
    Process Successful
    That build time warning wasn't to do with my actual code, so I claim that as 100% correct in the eyes of GNAT :D
     
  16. The undeniable truth

    The undeniable truth First Team Captain

    Joined:
    Jun 26, 2014
    Messages:
    34,849
    Likes Received:
    20,550
    Trophy Points:
    113
    Location:
    over here
    I’m sorry but this is inconsistent with MIDGE protocol.
     

Share This Page