Yo, Yo, Yo.

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

  1. cyaninternetdog

    cyaninternetdog Forum Hippie

    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

    received
     
    cyaninternetdog likes this.
  3. SkylaRose

    SkylaRose Administrator Staff Member

    JavaScript.... the most beloved scripting language.

    Did you write that yourself?
     
  4. Keighley

    Keighley First Team

    I have literally no idea what is going on.
     
  5. UEA_Hornet

    UEA_Hornet First Team Captain

    Gino Pozzo, is that you?
     
    SkylaRose and Keighley like this.
  6. SkylaRose

    SkylaRose Administrator Staff Member

    Cat is out of the bag now Keighley... :p
     
  7. The undeniable truth

    The undeniable truth First Team Captain

    We are a yo yo yo club.
     
  8. SkylaRose

    SkylaRose Administrator Staff Member

     
  9. Ilkley

    Ilkley Formerly known as An Ilkley Orn Baht 'at

    42
     
  10. SkylaRose

    SkylaRose Administrator Staff Member

    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;
     
  11. The undeniable truth

    The undeniable truth First Team Captain

    Worrying if true.
     
  12. SkylaRose

    SkylaRose Administrator Staff Member

    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:

    ########
    '''''''''''#
    '''''''''''#
    ''''''''''#
     
  13. Ilkley

    Ilkley Formerly known as An Ilkley Orn Baht 'at

    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.
     
  14. SkylaRose

    SkylaRose Administrator Staff Member

    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
     
  15. The undeniable truth

    The undeniable truth First Team Captain

    I’m sorry but this is inconsistent with MIDGE protocol.
     

Share This Page