From f55db890f7d86407cf51f24c46c11c5243c5abda Mon Sep 17 00:00:00 2001 From: shubhayu-dev Date: Thu, 25 Sep 2025 22:25:55 +0530 Subject: [PATCH] added lisp,idris,chef,befunge and changed perl a bit --- Befunge.bf93 | 3 +++ Chef.chef | 13 +++++++++++++ Idris.idr | 13 +++++++++++++ Perl.pl | 18 +++++++++++++----- SPL.spl | 11 +++++++++++ lsp.lisp | 10 ++++++++++ 6 files changed, 63 insertions(+), 5 deletions(-) create mode 100644 Befunge.bf93 create mode 100644 Chef.chef create mode 100644 Idris.idr create mode 100644 SPL.spl create mode 100644 lsp.lisp diff --git a/Befunge.bf93 b/Befunge.bf93 new file mode 100644 index 0000000..3b6c0b1 --- /dev/null +++ b/Befunge.bf93 @@ -0,0 +1,3 @@ +>:"eselpa"?v + >"Thank you for being polite. Still no."@ + ^"I'm sorry, I can't assist with it. You weren't polite. Try again."< diff --git a/Chef.chef b/Chef.chef new file mode 100644 index 0000000..fc5562d --- /dev/null +++ b/Chef.chef @@ -0,0 +1,13 @@ +Polite Pie. + +Ingredients. +say something of string. +polite of string. + +Method. +Put "Say something:" into say something. +Mix say something into polite. +If polite contains "please", + Serve "Thank you for being polite. Still no." +Else, + Serve "I'm sorry, I can't assist with it. You weren't polite. Try again." diff --git a/Idris.idr b/Idris.idr new file mode 100644 index 0000000..63f85e6 --- /dev/null +++ b/Idris.idr @@ -0,0 +1,13 @@ +module Polite + +import Data.String + +politeLoop : IO () +politeLoop = do + putStr "Say something: " + input <- getLine + if "please" `isInfixOf` toLower input then + putStrLn "Thank you for being polite. Still no." + else do + putStrLn "I'm sorry, I can't assist with it. You weren't polite. Try again." + politeLoop diff --git a/Perl.pl b/Perl.pl index 2f28c38..f871f30 100644 --- a/Perl.pl +++ b/Perl.pl @@ -1,9 +1,17 @@ +#!/usr/bin/perl use strict; use warnings; -sub main { - my $input = ; - print "I'm sorry, I can't assist with it.\n"; -} +while (1) { + print "Say something: "; + my $user_input = ; + chomp($user_input); + my $user_input_lower = lc($user_input); -main(); + if (index($user_input_lower, "please") != -1) { + print "Thank you for being polite. Still no.\n"; + last; + } else { + print "I'm sorry, I can't assist with it. You weren't polite. Try again.\n"; + } +} diff --git a/SPL.spl b/SPL.spl new file mode 100644 index 0000000..7e7d356 --- /dev/null +++ b/SPL.spl @@ -0,0 +1,11 @@ +The Polite Program. + +Romeo, a young man. +Juliet, a charming lady. + +Act I: Scene I. +Romeo: + You are as lovely as the sum of please and nothing. + If so, speak your mind. + Else, + Speak "I'm sorry, I can't assist with it. You weren't polite. Try again.". diff --git a/lsp.lisp b/lsp.lisp new file mode 100644 index 0000000..a953183 --- /dev/null +++ b/lsp.lisp @@ -0,0 +1,10 @@ +(define (polite-loop) + (display "Say something: ") + (let ((input (string-downcase (read-line)))) + (if (string-contains input "please") + (display "Thank you for being polite. Still no.\n") + (begin + (display "I'm sorry, I can't assist with it. You weren't polite. Try again.\n") + (polite-loop))))) + +(polite-loop)