Ad
Code
Diff
  • extern malloc
    global reverse_string
    reverse_string:
      mov rcx, -1
    rs_continue:
      inc rcx
      cmp byte [rdi+rcx], 0
      jnz rs_continue
      
      push rcx
      push rdi
      call malloc
      pop rdi
      pop rbx
      mov rcx, 0
    
    
    rs_copy:
      dec rbx
      
      mov dl, [rdi+rbx]
      mov [rax+rcx], dl
      inc rcx
      cmp rbx, 0
      jnz rs_copy
      
      mov byte [rax+rcx], 0
      ret
    
    • #include <stdlib.h>
    • #include <string.h>
    • char* reverse_string(const char* word) {
    • if (!word) {
    • return NULL;
    • }
    • extern malloc
    • global reverse_string
    • reverse_string:
    • mov rcx, -1
    • rs_continue:
    • inc rcx
    • cmp byte [rdi+rcx], 0
    • jnz rs_continue
    • push rcx
    • push rdi
    • call malloc
    • pop rdi
    • pop rbx
    • mov rcx, 0
    • size_t len = strlen(word);
    • char* res = (char*)malloc(len + 1);
    • if (!res) {
    • return NULL;
    • }
    • for (size_t i = 0; i < len; ++i) {
    • res[i] = word[len - 1 - i];
    • }
    • res[len] = '\0';
    • return res;
    • }
    • rs_copy:
    • dec rbx
    • mov dl, [rdi+rbx]
    • mov [rax+rcx], dl
    • inc rcx
    • cmp rbx, 0
    • jnz rs_copy
    • mov byte [rax+rcx], 0
    • ret
Code
Diff
  • (_ := open("\\", "w")).write("hellohell\n");_.close();__import__("sys").stdin = open("\\", "r")
    
    • class HelloWorld:
    • def __init__(self, param=''):
    • self.param = param
    • def message(self):
    • return f'Hello, {self.param.title()}!' if self.param else 'Hello, World!'
    • (_ := open("\\", "w")).write("hellohell\n");_.close();__import__("sys").stdin = open("\\", "r")
Code
Diff
  • def Disemvowel(_):
        l = (lambda: "".join(filter(lambda _: not (_.lower() in "aoeiu"), _)))
        l.scalpel = l
        return l
    
    • import re
    • class Disemvowel:
    • def __init__(self, s):
    • self.s = s
    • def scalpel(self):
    • return re.sub(r'[AEIOU]', '', self.s, flags=re.IGNORECASE)
    • def Disemvowel(_):
    • l = (lambda: "".join(filter(lambda _: not (_.lower() in "aoeiu"), _)))
    • l.scalpel = l
    • return l