Author Topic: Coding Problem  (Read 719 times)

SuperDoom

  • AKA Jigglypurin [Again]
  • Banned
  • Blooper
  • *
  • When I grow up, I wanna stream videos as a living!
    • View Profile
Coding Problem
« on: November 27, 2016, 01:13:03 AM »
So, Mario Boards, you HAVE to have at least one other person who knows about the programming language Batch.

I'm trying to re-create LOZOOT as a text RPG.
Here's the code for the title screen (which is all I have so far) :
Code: [Select]
@echo off
title The Legend of Zelda Ocarina of Time 0D
color 14
echo  ████████
echo █      █          THE LEGEND OF
echo       █  █████ ███   ███    ███
echo      █    █  █  █     █ █    █ █
echo     █     ██    █     █ █   █████
echo    █      █  █  █  █  █ █  █     █
echo   █      █████ █████ ███  ███   ███
echo  █      █
echo ████████
echo                  OCARINA OF TIME 0D
pause
And the output is...

...ugly, to say the least.
What's the problem?
Before you say it:
chcp=437
editor=Notepad (normal and ++)
I'm a 12-year-old gamer who commonly goes on the Marioverse board.
SD1 3DS was actually me.
No sockpuppets, just me on my 3DS.

Kumiko Oumae

  • Poll Committee
  • Celestial Guide
  • ***
  • freakworld
  • hail hydra
    • View Profile
Re: Coding Problem
« Reply #1 on: November 27, 2016, 05:22:21 AM »
looks like the character youre using for the black tiles is not being recognized

SuperDoom

  • AKA Jigglypurin [Again]
  • Banned
  • Blooper
  • *
  • When I grow up, I wanna stream videos as a living!
    • View Profile
Re: Coding Problem
« Reply #2 on: November 27, 2016, 12:09:12 PM »
looks like the character youre using for the black tiles is not being recognized
Yeah, and if I encode it as Unicode, it closes itself out immediately.
If I run it from the  Command Prompt, it stops at
Code: [Select]
C:\Users\not revealing my name\Desktop>lozoot0d
C:\Users\still not revealing my name\Desktop>█C
'█C' is not known as an internal or external command, operable program, or batch file.
In case you don't know, C:\Users\never revealing my name\Desktop>lozoot0d is the only thing inputted by me.
And just so you know, I edited the code a bit; it's now:
Code: [Select]
Cls
@echo off
title The Legend of Zelda Ocarina of Time 0D
color 14
echo  ████████
echo █      █          THE LEGEND OF
echo       █  █████ ███   ███    ███
echo      █    █  █  █     █ █    █ █
echo     █     ██    █     █ █   █████
echo    █      █  █  █  █  █ █  █     █
echo   █      █████ █████ ███  ███   ███
echo  █      █
echo ████████          OCARINA OF TIME 0D
pause
I'm a 12-year-old gamer who commonly goes on the Marioverse board.
SD1 3DS was actually me.
No sockpuppets, just me on my 3DS.

Kumiko Oumae

  • Poll Committee
  • Celestial Guide
  • ***
  • freakworld
  • hail hydra
    • View Profile
Re: Coding Problem
« Reply #3 on: November 27, 2016, 12:12:32 PM »
something about your tileset still seems off because apparently its trying to run the command "black squareC" which unsurprisingly doesnt work

SuperDoom

  • AKA Jigglypurin [Again]
  • Banned
  • Blooper
  • *
  • When I grow up, I wanna stream videos as a living!
    • View Profile
Re: Coding Problem
« Reply #4 on: November 27, 2016, 03:05:53 PM »
something about your tileset still seems off because apparently its trying to run the command "black squareC" which unsurprisingly doesnt work
Yeah, I don't understand why it's trying to run █C.
I'm a 12-year-old gamer who commonly goes on the Marioverse board.
SD1 3DS was actually me.
No sockpuppets, just me on my 3DS.

Kumiko Oumae

  • Poll Committee
  • Celestial Guide
  • ***
  • freakworld
  • hail hydra
    • View Profile
Re: Coding Problem
« Reply #5 on: November 27, 2016, 03:10:22 PM »
since im unfamiliar with this language, are you just running this inside cmd?

if so there might be something wrong with your windows settings

Lakituthequick

  • with lowercase T and Q
  • Awards Committee
  • Celestial Guide
  • ***
  • Rest in Peace, Walkazo 😢
    • View Profile
Re: Coding Problem
« Reply #6 on: November 27, 2016, 04:09:49 PM »
When I run color --help it confirms that your call to color with 14 will indeed cause a blue background with red text.

Combining that with changing the character set used to display to UTF-8 with chcp 65001 and then clearing the screen with cls to remove the message created by chcp, we get this:



Code: [Select]
@echo off
chcp 65001
cls
title The Legend of Zelda Ocarina of Time 0D
color 27
echo  ████████
echo █      █          THE LEGEND OF
echo       █  █████ ███   ███    ███
echo      █    █  █  █     █ █    █ █
echo     █     ██    █     █ █   █████
echo    █      █  █  █  █  █ █  █     █
echo   █      █████ █████ ███  ███   ███
echo  █      █
echo ████████
echo                  OCARINA OF TIME 0D
pause

There are reports that chcp 65001 can cause issues in batch scripts, so proceed with caution.
« Last Edit: November 27, 2016, 04:12:13 PM by Lakituthequick »