Class of 2025 (2025 HSC CHAT) (2 Viewers)

Tony Stark

Well-Known Member
Joined
Jan 22, 2025
Messages
102
Location
https://maps.app.goo.gl/pDzZ5pcqruzP5YPS6
Gender
Male
HSC
2025
Python:
def linear():
    fx = input('Enter linear equation (y=mx+c): ').lower()
    #testing if there is a value for c, if not it is 0
    if fx[-1] == 'x':
        c = 0
    else:
        c = int(fx.partition('x')[-1])
    #testing if there is a value for m, if not it is 1
    if fx[0] == 'x':
        m = 1
    elif fx[0] != 'x':
        m = int(fx.partition('x')[0])
    else:
        m = int(input('Value for {y[0]}? '))
    print(f'm = {m}, c = {c}')
    obj = 'O'
    # if '-' not in fx:
    #     c = int(-c)
    x = 10
    # if m >= 3:
    #     obj = '|'
    # elif m < 3:
    #     obj = '/'
    print('^')
    while x > 1:
        for i in range(m-1):#logic to leave space for obj
            print('|') #move cursor downwards by m amount
            y = round((m * x) + c)
        print(f'|{' '*(x-2)}', end='')#-2 because there are two characters printed on the line
        print(obj)
        x = x - 1
    # print(obj)
    # for i in range(c):
    #     print('|')
    for i in range(c):
        print('|') 
    print(f'{'﹉'*7}>')
        
while True:
    linear()
Beta program I will name 'Delta+' because why not (e.g input 3x+5)
 
Last edited:

Socialism

Well-Known Member
Joined
Jun 3, 2024
Messages
1,576
Location
🏳️‍⚧️Transnistria🏳️‍⚧️
Gender
Undisclosed
HSC
2026
Python:
def linear():
    fx = input('Enter linear equation (y=mx+c): ').lower()
    #testing if there is a value for c, if not it is 0
    if fx[-1] == 'x':
        c = 0
    else:
        c = int(fx.partition('x')[-1])
    #testing if there is a value for m, if not it is 1
    if fx[0] == 'x':
        m = 1
    elif fx[0] != 'x':
        m = int(fx.partition('x')[0])
    else:
        m = int(input('Value for {y[0]}? '))
    print(f'm = {m}, c = {c}')
    obj = 'O'
    # if '-' not in fx:
    #     c = int(-c)
    x = 10
    # if m >= 3:
    #     obj = '|'
    # elif m < 3:
    #     obj = '/'
    print('^')
    while x > 1:
        for i in range(m-1):#logic to leave space for obj
            print('|') #move cursor downwards by m amount
            y = round((m * x) + c)
        print(f'|{' '*(x-2)}', end='')#-2 because there are two characters printed on the line
        print(obj)
        x = x - 1
    # print(obj)
    # for i in range(c):
    #     print('|')
    for i in range(c):
        print('|')
    print(f'{'﹉'*7}>')
       
while True:
    linear()
Beta program I will name 'Delta+' because why not (e.g input 3x+5)
ts so hard to read in dark mode 😭
 

Socialism

Well-Known Member
Joined
Jun 3, 2024
Messages
1,576
Location
🏳️‍⚧️Transnistria🏳️‍⚧️
Gender
Undisclosed
HSC
2026

Users Who Are Viewing This Thread (Users: 0, Guests: 2)

Top