Code by Code game

Why? I did do what was asked, just had to clarify essentially. Also, @dragonhunter1 how would I do that without ast? Would I just use eval instead? And what breaks it? Is it nested dicts?

1 Like

Your code is very difficult, @Firepup650 . Can you send function that parses JSON into dict or JSON class with methods get(key) and set(key,value). Because I can’t understand your code, it’s too difficult, and I can’t give you a coin. Send the parse function, please

No, you would manually check if it was a number without quotes, it is an int. Anything surrounded in quotes is a string etc. This can probably be done not too hard using a parser generator library, but by hand it would take probably 300+ lines. (Here is an example of a parser by hand, except in nim and an XML parser, which imo is easier then writing a json parser: Pure-Nim hand-written xml parser, using only stdlib · GitHub)

Probably

I’ll work on that then I suppose. (Only going to do ints+floats, strings, nested dicts, and lists)

In that case, I think I fixed it now.

1 Like

Ok, I finished it:

https://repl.it/@element1010/UpdateMeNow

1 Like

Funny, 1 coin rewarded

@element1010 create a task for @Djrahul22.

1 Like

Sorry everybody. I was at my grandparents house and I can participate now.

x = input ("Hello world")
// technically prints hello world

sorry for the late response, I was at my grandparents’ house.

@Djrahul22 Language: Java, Description: Write “Hello world!” without using Strings or the char type at all.

3 Likes

Can I still join or it’s full

So… Lists or dicts being nested causes me issues. That’s fun.

Ye, you can still join.

There is no “full” to this game. When we reach the end of the list and no one new joins, we’ll wrap around to the first person I guess

3 Likes

I’m ready for my task. I saw that @element1010 did the one @Firepup650 had originally assigned me to do, so who will decide what I do next?

You could do the one @element1010 assigned to @Djrahul22.

I thought I might make a table

Assigner Assignee Language Description Completer
NataliaKazakiev ParanormalCoder Python create a console form where you write your username and password and then you’ll see a message “success” ParanormalCoder
ParanormalCoder Next Bash print “Hello, World!” ten times using a loop CadenChau
CadenChau BananaPI Python print ‘Hello, World!’ without using the print() function QwertyQwerty88
QwertyQwerty88 dragonhunter1 Any create a function to detect if a string is a palindrome dragonhunter1
dragonhunter1 Firepup650 Python make a unique JSON parser in python Firepup650
Firepup650 bobbypac HTML/CSS/JS make a page that allows you to add to it VIA an input box, a drop down for selecting the type, etc. (Bare HTML/CSS/JS if possible) element1010
element1010 Djrahul22 Java Write “Hello world!” without using Strings or the char type at all. bobbypac
bobbypac NataliaKazakiev Python create a template allowing users to easily create their own API
3 Likes

Wish me luck, I know absolutely nothing about Java.

2 Likes

This is exactly why I chose that language. Because much of the community knows nothing about Java/hates Java.

2 Likes

I know some java, but I don’t particularly hate it or like it. It’s just there. I find other languages easier to use, and better IMO.

3 Likes

Sorry this took so long, I think I have found a solution. (I had to learn some Java and do a lot of googling to answer this)

Yes, this technically does use the String type, but I can’t think of another alternative. Sorry!

public class HelloWorld {
    public static String helloWorld() {
      byte ascii[] = { 72, 101, 108, 108, 111, 44, 32, 87, 111, 114, 108, 100, 33 };
      String str = new String(ascii);
      return str;
    }
}

I guess because @Djrahul22 isn’t going, it’ll start over again with @NataliaKazakiev.

Using Python, create a template allowing users to easily create their own API.

2 Likes
from flask import Flask, jsonify, request

app = Flask(__name__)

users = {}

@app.route('/', methods=['GET'])
def home():
    return jsonify({'message': 'Welcome to the API!'})

@app.route('/register', methods=['POST'])
def register():
    data = request.get_json()
    username = data['username']
    password = data['password']
    users[username] = password
    return jsonify({'message': 'User registered successfully!'})

@app.route('/login', methods=['POST'])
def login():
    data = request.get_json()
    username = data['username']
    password = data['password']
    if username in users and users[username] == password:
        return jsonify({'message': 'Login successful!'})
    else:
        return jsonify({'message': 'Invalid username or password!'})

if __name__ == '__main__':
    app.run(debug=True)

i dont know lol just a register username + password kind of thing ig

1 Like