Multicode! A collaborational game

Instructions

  • Players take turns coding.
  • When a player is done with their turn, they give a task to the next player.
  • The next player must then code that task in as many languages as they can.
  • You get one point for each language you code it in without any bugs.
  • If someone tries to run someone’s code (on Replit only), and gets a bug, that player loses 1.5 points and the bug catcher gains 0.7 points.
  • If you do not give an answer in 48 hours, your turn is skipped and you lose 5 points.
  • The above rule does not apply if someone (@element1010) checks the user’s profile and notices that their Last seen date is 2 or more days ago.
  • If you somehow manage to answer in BrainF, you gain 10 points.
  • If someone has evidence that you are using AI or Google Search to answer, you lose 20 points!
  • If a player is done with their turn, and they do not give a task to the next player within 1 hour and the post was within 5 minutes, @element1010 will give a task to the next player.

Point tally

Player Points Turns
element1010 0 0
InvisibleOne 11 1
ParanormalCoder 3 1
QwertyQwerty88 5 1
Firepup650 -5 0
NataliaKazakiev 0 0
python660 0 0
OmegaOrbitals 0 0
L3mm1ngs 0 0
bigminiboss 0 0

Join
Select Join the game! to join.
Note: @TaokyleYT is currently inactive and we will pretend he is not in the game until further notice.

Join
  • Join the game!

0 voters

Code Archives
This is where all the code will go.

JavaScript code (NodeJS included)
Python code
HTML code

No code yet!

Java code
C code
PHP code
C++ code
SQL code

No code yet!

Dart code
Kotlin code
Ruby code
Go code
LOLCODE (esolang) code
Swift code
Lua code
BrainF code

No code yet!

If you submit code in a language that isn’t on here (yet) it will be added on.

Logs
History of the game

Logs
InvisibleOne finished element1010's task and earned 11 points
ParanormalCoder finished InvisibleOne's task and earned 3 points
QwertyQwerty88 finished ParanormalCoder's task and earned 5 points
Firepup650 failed to complete QwertyQwerty88's task in 48 hours and lost 5 points
bigminiboss joined the game
1 Like

@InvisibleOne

To start off the game:

Task: Write a simple text game with I/O. Use as many languages as you can.

2 Likes

Alrighty… I think I can do all of them except maybe SQL:

Javascript

var number = Math.floor(Math.random()*9)+1

while (true) {
	alert("I'm thinking of a number...")
	input = prompt("Number: ")
	if (parseInt(input) == number) {
		break
	}
	alert("Incorrect")
}
alert("You got it!")

Python

import random


number = random.randint(1, 10)

while True:
	print("I'm thinking of a number")
	num = input("-> ")

	if num == str(number):
		break

	print("Incorrect")


print("You got it!")

HTML

Unless I can use JS or CSS I can’t do it in just plain ole HTML.

Java

import java.util.Scanner;
import java.util.Random;

class Main {
  public static void main(String[] args) {
	  Random rand = new Random(); 
	  int number = rand.nextInt(10);
	  while (true) {
		System.out.print("I'm thinking of a number\n-> ");
		Scanner in = new Scanner(System.in);
		int guess = in.nextInt();
		if (guess == number) {
			break;
		}
		System.out.println("Incorrect");
	  }
	  System.out.println("You got it!");
  }
}

C

#include <stdio.h>
#include <time.h>

int main(void) {
	srand(time(NULL));
	int number = rand() % 10;   
	while (1) {
		printf("I'm thinking of a number\n-> ");

		int guess;

		scanf("%d", &guess);

		if (guess == number) {
			break;
		}
		printf("Incorrect\n");
	}
	printf("You got it!\n");
	return 0;
}

PHP

<?php
$number = rand(1, 10);
while (true) {
	echo "I'm thinking of a number\n";
	$int = (int)readline("-> ");
	if ($int == $number) {
		break;
	}
	echo "Incorrect\n";
}
echo "You got it!\n";

C++

#include <iostream>

int main() {
	int number = 1 + (rand() % 10);

	while (true) {
		std::cout << "I'm thinking of a number\n-> ";
		int guess;
		std::cin >> guess;
		if (guess == number) {
			break;
		}
		std::cout << "Incorrect\n";
	}
  std::cout << "You got it!\n";
}

SQL

I’m not gunna try in SQL

Dart

I’ve never used Dart before so this will be fun

// was actually pretty fun and I mostly just guessed
// seemed pretty intuitive, I think I kinda like dart
import "dart:io";
import "dart:math";

void main() {
	var rand = Random();
	int random = rand.nextInt(9)+1;
	while (true) {
		print("I'm thinking of a number\n-> ");
		int? guess = int.parse(stdin.readLineSync()!);
		if (guess == random) {
			break;
		}
		print("Incorrect");
	}
  print("You got it!");
}

Kotlin

import java.util.Scanner;

fun main(args: Array<String>) {
	var scanner = Scanner(System.`in`)
	var random = (1..10).random()
	while (true) {
		println("I'm thinking of a number")
		print("-> ")
		var guess = scanner.nextInt()
		if (guess == random) {
			break
		}
		println("Incorrect")
	}
	println("You got it!")
}
2 Likes

It’s just my game. But I don’t mind.

2 Likes

No, I modified it a little bit. Instead of someone providing the language, you have to try to code it in as many languages as you can.

1 Like

Oh and I just realized I can do this in languages that weren’t on the list… so I’m going to add a few that I like.

Ruby


num = rand(1..10)

while true do
	puts "I'm thinking of a number"
	print "-> "
	guess = gets.chomp.to_i
	if guess == num then
		break
	end
	puts "Incorrect"
end

puts "You got it!"

Go

package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	rand.Seed(time.Now().UnixNano())
	number := rand.Intn(10)
	fmt.Println(number)
	for {
		fmt.Print("I'm thinking of a number\n-> ")
		var guess int
		fmt.Scanf("%d", &guess)
		if (guess == number) {
			break
		}
		fmt.Println("Incorrect!")
	}
	fmt.Println("You got it!")
}

LOLCODE

BTW It's not an actual random number since it's hard coded lol...
HAI 1.2
	CAN HAS STDIO?
	I HAS A random ITZ "5"
	IM IN YR LOOPY
		VISIBLE "I HAVE NUMBR?"
		I HAS A num
		GIMMEH num
		BOTH SAEM num AN random, OH RLY?
			YA RLY, GTFO
			NO WAI, VISIBLE "WRONG"
		OIC
	IM OUTTA YR LOOPY
	VISIBLE "YOU GOT IT!!!"
KTHXBYE

I could add a few more but I’m too lazy at the moment

3 Likes

Alright I’m done… for my challenge: Make a Caesars cipher encoder… You don’t have to do the decode part unless you want.

@ParanormalCoder It’s your turn, do @InvisibleOne’s task.

If you do, you get an extra 0.5 points per language.

3 Likes

I thought you hated Java! =P

I do but I need to win

Do you get anything for winning?

1 Like

No unfortunately.

I would give 100 Cycles but I only have 70.

2 Likes

Python

def caesarCipher(word, howManyPlaces):
  letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
  word = word.lower()
  word = list(word) 
  print(word)
    
  for i in range(len(word)):
    index = 25
    while index >= 0: 
      if word[i] == letters[index]:
        print('before:', word[i])
        newLetter = letters[(index + howManyPlaces) % 26]  
        word[i] = newLetter
        print('after:', word[i])
      index = index - 1

  word = ''.join(word)
  print(word)
  return word
          

caesarCipher('Hello World', 2)

Javascript

function caesarCipher(word, howManyPlaces){
  let letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
  word = word.toLowerCase();
  word = word.split('');
  console.log(word)
    
  for (var i = 0; i < word.length; i++) {
    index = 25
    while (index >= 0){ 
      if (word[i] == letters[index]){
        console.log('before:', word[i])
        newLetter = letters[(index + howManyPlaces) % 26]  
        word[i] = newLetter
        console.log('after:', word[i])
      }
      index = index - 1
    }
  }
  word = Array.from(word).join('');
  console.log(word)
  return word
} 

Swift

func caesarCipher(_ word: String, _ howManyPlaces: Int) -> String {
    let letters = Array("abcdefghijklmnopqrstuvwxyz")
    var modifiedWord = ""
    
    for character in word.lowercased() {
        if let index = letters.firstIndex(of: character) {
            let newIndex = (index + howManyPlaces) % letters.count
            modifiedWord.append(letters[newIndex])
        } else {
            modifiedWord.append(character)
        }
    }
    
    return modifiedWord
}

let originalWord = "Hello World"
let shiftedWord = caesarCipher(originalWord, 2)

print("Original word: \(originalWord)")
print("Shifted word: \(shiftedWord)")

Ok, It’s @QwertyQwerty88’s turn

@ParanormalCoder make a task for @QwertyQwerty88.

1 Like

Ok, @QwertyQwerty88 make a Palindrome Checker, for example if you put in a palindrome like tacocat it will return true

1 Like

Python

def isPalindrome(word: str) -> bool:
    return word.lower()[::-1] == word.lower()


if isPalindrome("Tacocat"):
    print("Tacocat is a palindrome!")

Lua

local function isPalindrome(word)
    return string.reverse(string.lower(word)) == string.lower(word)
end

if isPalindrome("Tacocat") then
   print("Tacocat is a palindrome!") 
end

JavaScript

isPalindrome = word => word.toLowerCase().split("").reverse().join("") === word.toLowerCase();

if (isPalindrome("Tacocat")) console.log("Tacocat is a palindrome!");

C

#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdbool.h>

bool isPalindrome(char word[]) {
    int l = 0;
    int h = strlen(word) - 1;

    while (h > l) {
        if (tolower(word[l++]) != tolower(word[h--])) return false;
    }
    return true;
}

int main(void) {
    if (isPalindrome("Tacocat")) {
        printf("Tacocat is a palindrome!\n");
    }
    return 0;
}

C++

#include <iostream>
#include <string>
#include <cctype>

bool isPalindrome(std::string word) {
    int l = 0;
    int h = word.length() - 1;

    while (h > l) {
        if (std::tolower(word[l++]) != std::tolower(word[h--])) return false;
    }
    return true;
}

int main() {
    if (isPalindrome("Tacocat")) {
        std::cout << "Tacocat is a palindrome!" << std::endl;
    }
    return 0;
}
3 Likes

Ok @QwertyQwerty88

Now make a task for @Firepup650

This is a good way to learn

3 Likes

@Firepup650 Under the new rules, I give you a task:

Write an application with authentication.

(Since you cannot do this in that many languages, you get 2 points per language)

Replit auth? (I know it’s not my turn but I’m curious)