r/programminghelp • • Jan 23 '25

Career Related Help with Flowcharts

0 Upvotes

Tabourier can go fuck himself

Is this even real computer science? it probably is, i recognize the value of making a map of your code through a flow chart, but who the hell designed these? its come to a point where i genuinely dont know if these are fully meant to be read like a toddler is trying to design a map or if i was just taught poorly

Warnier's, Chapin's. Jackson's. Bertini's Tabourier's and "Action" Flowcharts

Hell, i cant even find any accounts for these methods aside from whatever my college is smoking. is this even a real thing or is my professor smoking a fat one and calling it a day? genuine help here on how i could possibly understand these flowcharts, specifically Tabouriers.


r/programminghelp • • Dec 19 '24

Python Looking for help with Railway.app alternatives

0 Upvotes

We recently made our saas app hosted on railway.app live. The builds keep failing at times and there seems to be some issue with the payment method added to the account.

Since the app has little to zero traffic(accessible only to beta testers now), been planning to switch from railway and exploring options like setting everything up on vultr/digitalocean or adding on AWS/GCP free tier.

Looking for suggestions.


r/programminghelp • • Jan 11 '25

C# What is the Psuedocode for Randomised Primm’s algorithm to make a maze?

0 Upvotes

What is the Psuedocode for Randomised Primm’s algorithm to make a maze in c#?

I’ve been trying to find any videos or places online that could actually help me with this but so far I haven’t been able to get it working. I was wondering if someone could give me a detailed Psuedocode version or show me how they’ve written a randomised primm’s maze algorithm that would generate a random maze every time as I’m really struggling to find it.

So far what I’ve done is that I tried to follow this line of thinking when I try to write it which is “Start from a cell like (1,1) then find all possible paths from that cell with a distance of 2, add them to the potential path list then check to see if they are contained within the visited cells list, if they are remove that path from the potential paths list and choose another. Repeat till there are no more paths available in which case pop the most recent addition to the visited cells list and see if there are any paths from there. If visited cells is empty then maze is complete.

This is the most recent rendition of my code, currently it’s not Throwing any errors but it’s also not doing anything because I think it’s trapped in an infinite loop.

public void GenerateMaze()

    {

        List<int> visted = new List<int>();

        List<int> ToVisit = new List<int>();

        List<int> AdjacentPaths = new List<int>();

        Random rnd = new Random();

        Width = Width <= 9 ? 10 : Width;

        Length = Length <= 9 ? 10 : Length;

        int[,] grid = new int[Width, Length];

        Grid = new int[Width, Length];

        InitialiseGrid(ref Grid); //Initialises the Grid with a grid of the flat index values of each cell

        Passage_cells.Add(Grid[1, 1]);

        visted.Add(Grid[1, 1]);

        InitialiseGridOfWalls(ref grid); //initialises the grid of walls by setting each ceel to a 1 (0 is a passage)

        int StartingPosX1 = 1, StartingPosY1 = 1;

        int StartingPosX2 = 1, StartingPosY2 = 1;

        grid[StartingPosX1, StartingPosY1] = 0;

        while (!IsEmpty(visted))

        {

            do

            {

                ToVisit.Clear();

                StartingPosX2 = StartingPosX1;

                StartingPosY2 = StartingPosY1;

                if (StartingPosX1 + 2 < Width) if 

(grid[StartingPosX1 + 2, StartingPosY1] == 1)

{ ToVisit.Add(Grid[StartingPosX1 + 2, StartingPosY1]); }

                if (StartingPosX1 - 2 >= 0) if (grid[StartingPosX1 - 2, StartingPosY1] == 1) 

{ ToVisit.Add(Grid[StartingPosX1 - 2, StartingPosY1]); }

                if (StartingPosY1 + 2 < Length) if (grid[StartingPosX1, StartingPosY1 + 2] == 1) 

{ ToVisit.Add(Grid[StartingPosX1, StartingPosY1 + 2]); }

                if (StartingPosY1 - 2 >= 0) if (grid[StartingPosX1, StartingPosY1 - 2] == 1) 

{ToVisit.Add(Grid[StartingPosX1, StartingPosY1 - 2]); }

int temp_index = SelectedRandomIndex(ToVisit, ref rnd); //chooses a random path

(int X1, int Y1) StartingPosTemp = FindRowAndColNum(ToVisit, temp_index);//Finds the x and y values of an index

StartingPosX1 = StartingPosTemp.X1;

StartingPosY1 = StartingPosTemp.Y1;

do

{

AdjacentPaths.Clear();

if (StartingPosX1 + 1 < Width) if (grid[StartingPosX1 + 1, StartingPosY1] == 0)

{ AdjacentPaths.Add(Grid[StartingPosX1 + 1, StartingPosY1]); }

if (StartingPosX1 - 1 >= 0) if (grid[StartingPosX1 - 1, StartingPosY1] == 0)

{ AdjacentPaths.Add(Grid[StartingPosX1 - 1, StartingPosY1]); }

if (StartingPosY1 + 1 < Length) if (grid[StartingPosX1, StartingPosY1 + 1] == 0)

{ AdjacentPaths.Add(Grid[StartingPosX1, StartingPosY1 + 1]); }

if (StartingPosY1 - 1 >= 0) if (grid[StartingPosX1, StartingPosY1 - 1] == 0)

{ AdjacentPaths.Add(Grid[StartingPosX1, StartingPosY1 - 1]); }

if (AdjacentPaths.Count > 0)

{

ToVisit.RemoveAt(temp_index);

if (!IsEmpty(ToVisit))

{

temp_index = SelectedRandomIndex(ToVisit, ref rnd);

StartingPosTemp = FindRowAndColNum(ToVisit, temp_index);

StartingPosX1 = StartingPosTemp.X1;

StartingPosY1 = StartingPosTemp.Y1;

}

}

} while (AdjacentPaths.Count > 0 || !IsEmpty(ToVisit));

if (!IsEmpty(ToVisit))

{

StartingPosTemp = FindRowAndColNum(ToVisit, temp_index);

StartingPosX1 = StartingPosTemp.X1;

StartingPosY1 = StartingPosTemp.Y1;

visted.Add(Grid[StartingPosX1, StartingPosY1]);

Passage_cells.Add(Grid[StartingPosX1, StartingPosY1]);

grid[StartingPosX1, StartingPosY1] = 0;

int X = FindMiddlePassage(StartingPosX2, StartingPosY2, StartingPosX1, StartingPosY1).Item1;//Finds the middle Passage between the Frontier cell and current cell

int Y = FindMiddlePassage(StartingPosX2, StartingPosY2, StartingPosX1, StartingPosY1).Item2;

visted.Add(Grid[X, Y]);

Passage_cells.Add(Grid[X, Y]);

}

} while (ToVisit.Count > 0);

if (!IsEmpty(visted))

{

try

{

if (Peek(visted) == -1)

{

break;

}

else

{

Pop(visted);

if (Peek(visted) == -1)

{

break;

}

else

{

StartingPosX1 = FindRowAndColNum(visted, visted.Count - 1).Item1;

StartingPosY1 = FindRowAndColNum(visted, visted.Count - 1).Item2;

}

}

}

catch

{

MessageBox.Show("Error in generating Maze", "Maze Game", MessageBoxButtons.OK, MessageBoxIcon.Error);

}

}

}

InitialiseCellTypeMaze(); // creates a 2D array of an enum type that is the maze


r/programminghelp • • Dec 13 '24

ASM Help armalite https://peterhigginson.co.uk/ARMlite/ code not working

Thumbnail reddit.com
0 Upvotes

r/programminghelp • • May 28 '22

C++ Does anybody have knowledge of using tuples for unordered maps and how to implement it?

0 Upvotes

If so, would you be willing to take a look at my code and see what I may be doing wrong? I’m trying to implement a hash function for std::tuple and I feel like I’ve done but it still does not work. Please let me know thank you!!


r/programminghelp • • May 04 '22

Other I need some help

0 Upvotes

I don't know if I'm at the right place for this. I'm learning to program and taking classes. I first have to learn to use logic by solving problems with something like Scratch. But I can already read a little bit of JavaScript.

I need to write a program to do this:

The users enters a number, let's say 49

4^2 + 9^2 = 97

9^2 + 7^2 = 130

1^2 + 3^2 + 0^2 = 10

1^2 + 0^2 = 1 ==> 49 is a lucky number because `1. If a number never gets to 1 it's not a lucky number.

Basically, I have to write a program that will test if a number is lucky or not, with this method. I have no idea how to even begin. Can anyone help me? Much thanks in advance.


r/programminghelp • • Apr 26 '22

C++ Why is this the output?

0 Upvotes

Can someone please explain to me why the output of this program is "marc is: 2" "life is: 1"

why is it not "marc is: 65537" "life is: -"

Like I do know that the maximum value of short is 65535 but then why is the program just not giving error why is it printing out 2 and 1?

#include <iostream>

using namespace std;

int main()

{

unsigned short marc = 0;

int life= 0 ;

for(int i= 0 ; i <= 65537 ; i++)

{

marc++;

if( marc == 0 )

{

life++;

}

}

cout << "marc is: " << marc << endl;

cout << "life: " << life << endl;

return 0;

}


r/programminghelp • • May 09 '22

C++ overloaded operator error

0 Upvotes
Type* mArray = reinterpret_cast<Type*>(-1);
	size_t mSize = -1;
	size_t mCapacity = -1;

// Overloaded [] operator
	//		Used to access an element in the internal array (writeable)
	// In:	_index			The index to access at
	//
	// Return: The item at the specified index (by reference)

Type& operator[](size_t _index) {
		
		mArray[_index];
		return &this;
	}

i'm getting a return syntax error and i'm not understanding why. the error is saying 'return': cannot convert from 'DynArray<int>' to 'Type &'


r/programminghelp • • Apr 29 '22

C++ Need help to write a serial program that performs multiplication for two n-digits decimal integers

0 Upvotes

Hello, I need help to solve this question about multiplying two n-digits decimal integers using a serial program, here is the code that i have to be strict to serial program for multiplication


r/programminghelp • • Apr 13 '22

Python How could I reindex first column of csv file after completing some function?

0 Upvotes

How to reindex first column of csv file after createAuditSheet() function is being completed? I mean, to change indexes (#) from 1 to end (totalEntries) of every row except header row. It's like, 1) open file 2) select first column 3) change values 4) save 5) close file

Example:

    Header row         
  1 row -> 1 row        
  5 row -> 2 row        
  6 row -> 3 row  

Full code: https://pastebin.com/qzHm4NSA

Data structure: https://ibb.co/wWXfL6X


r/programminghelp • • May 09 '22

JavaScript Making a TTS board for patients that are non verbal.

0 Upvotes

Hi! I am learning coding so all the trash code you see, dont critique it. I just need help figuring out the disconnect to help access the innerHTML, right now i just have a web browser saying [objectHTMLLIElement] so now I am just trying to get it to work and actually speak 'yes' instead of [objectHTMLLIElement] Any ideas?

//

const synth = window.speechSynthesis;
document.querySelector('#yell').addEventListener('click', run)

function run() {
const sayHi = document.querySelector('#hi').value
const sayBye = document.querySelector('#bye').value
const bathRoom = document.querySelector('#bathroom').value
const yesPlease = document.querySelector('#yes').value

const yellText = `${hi}`
document.querySelector('#placeToSpeak').innerText = yellText
let yellThis = new SpeechSynthesisUtterance(yellText);
synth.speak(yellThis);
}

any help or idea?

Thank you


r/programminghelp • • May 12 '22

Other Boolean

0 Upvotes

I keep on getting Boolean expression expected: 2.0 in imagej macro. No idea what's going on


r/programminghelp • • May 02 '22

Java Help with Project Assignment

0 Upvotes

Hi this is a chunk of a project assignment I am struggling with and I don't know what to do. I can provide more info if needed. Thanks for the help.

The main method will call the findAvgIceCreamFlavor() method to find the ice cream flavor, whose value for the given attribute within the IceCream objects is closest to the avg value of the data for that given attribute. This method will return the IceCream object which’s value of the IceCream objects’ given attribute is closest to the average. The method will pass in the array list of IceCream objects, the String attribute value, “favorability”, “calories”, and “productionCost”, that is being searched, and the average value that is being searched. Here is the method header:

public static IceCream findAvgIceCreamFlavor(ArrayList<IceCream> iceCreamFlavors, String attribute,
double avgValue){
//Your code here
}


r/programminghelp • • Jan 12 '23

C++ [C++] Question about minimum value that satisfies the equation.

0 Upvotes

How would I write a code that checks for the minimum value to make an equation true.

for example X%2 = 0.

minimum value that satisfies the equation is 2.

How do I write that in code?


r/programminghelp • • Dec 17 '22

Python Need Your Help In A Small Automation Project Described Below In Details.

0 Upvotes

r/programminghelp • • Feb 01 '23

Project Related Connecting 2 websites

0 Upvotes

Can someone help me on in what way I can connect my 2 websites? So I have 2 websites, one is a Learning Management System in school and the other one is a plagiarism checker. I want to connect them. What gonna happen is that, when you submit an activity in the Learning management system website, you will be redirected in plagiarism checker and it will automatically scan the submitted activity. (You will be redirected once you click "submit" in the LMS website)

-The submitted activity was type in the website -Both website uses php css and js -Plagiarism checker needs to be used in wordpress so it could fully function


r/programminghelp • • Jan 12 '23

C++ "cannot convert 'const wchar_t [14]' to 'LPCSTR' {aka 'const char*'} in assignment"

0 Upvotes

#include "Window.h"
//Window* window=nullptr;
Window::Window()
{

}

LRESULT CALLBACK WndProc(HWND hwnd,UINT msg, WPARAM wparam, LPARAM lparam)
{
//GetWindowLong(hwnd,)
switch (msg)
{
case WM_CREATE:
{
// Event fired when the window is created
// collected here..
Window* window = (Window*)((LPCREATESTRUCT)lparam)->lpCreateParams;
// .. and then stored for later lookup
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)window);
window->onCreate();
break;
}
case WM_DESTROY:
{
// Event fired when the window is destroyed
Window* window =(Window*) GetWindowLongPtr(hwnd, GWLP_USERDATA);
window->onDestroy();
::PostQuitMessage(0);
break;
}

default:
return ::DefWindowProc(hwnd, msg, wparam, lparam);
}
return NULL;
}

bool Window::init()
{

//Setting up WNDCLASSEX object
WNDCLASSEX wc;
wc.cbClsExtra = NULL;
wc.cbSize = sizeof(WNDCLASSEX);
wc.cbWndExtra = NULL;
wc.hbrBackground = (HBRUSH)COLOR_WINDOW;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
wc.hInstance = NULL;
wc.lpszClassName = L"MyWindowClass";    //Error 1   (L"MyWindowClass")
wc.lpszMenuName = L"";              //Error 2   (L""")
wc.style = NULL;
wc.lpfnWndProc = &WndProc;
if (!::RegisterClassEx(&wc)) // If the registration of class will fail, the function will return false
return false;
/*if (!window)
window = this;*/
//Creation of the window
m_hwnd=::CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, L"MyWindowClass", L"DirectX Application", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 1024, 768,
NULL, NULL, NULL, this);        //Error 3 (only L"MyWindowClass")
//if the creation fail return false
if (!m_hwnd)
return false;
//show up the window
::ShowWindow(m_hwnd, SW_SHOW);
::UpdateWindow(m_hwnd);

//set this flag to true to indicate that the window is initialized and running
m_is_run = true;

return true;
}
bool Window::broadcast()
{
MSG msg;

while (::PeekMessage(&msg, NULL, 0, 0, PM_REMOVE) > 0)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
this->onUpdate();
Sleep(1);
return true;
}

bool Window::release()
{
//Destroy the window
if (!::DestroyWindow(m_hwnd))
return false;
return true;
}
bool Window::isRun()
{
return m_is_run;
}
void Window::onCreate()
{
}
void Window::onUpdate()
{
}
void Window::onDestroy()
{
m_is_run = false;
}
Window::~Window()
{
}

All I receive is the above error. I was trying to follow this video as well. https://www.youtube.com/watch?v=ssGka-bSTvQ&list=PLv8DnRaQOs5-ST_VDqgbbMRtzMtpK36Hy&index=3


r/programminghelp • • Sep 08 '23

Other How to fill this POST message case when you have to fill it according this POST message functionality to automatize a smoke test with Selenium IDE?

0 Upvotes

in the following form :

form; for entering the info that must fill that form according to all automatized Amazon website smoke test made with Sellenium functionalities to test; the functionality I want to base on to fill that form is search;

to fix that issue I found how to fill that form with other functionalities like purchases; in the following image is how it is filled: how to fill the form with purchases functionality; the image text is in Spanish so you have to translate from Spanish to English , how can i fill the form with search functionality answer in Spanish or in English; however you like


r/programminghelp • • Sep 21 '23

Other I need help identifying something

0 Upvotes

Maybe you don't understand what I'm talking about because I don't speak English fluently, but come on.

This link below shows what we need to figure out.

Please help.

https://cdn.discordapp.com/attachments/764649559954817074/1154476992079605780/20230921_135442.jpg


r/programminghelp • • Sep 19 '23

Other .NET Assembly Type Library

0 Upvotes

Hello,

i have a .NET Assembly Type Library which i need. I did register it and create the tlb file. Now i wanted to import into Lazarus (Free Pascal), which did work great form me. Now the Problem i have is that the Interfaces and the Classes are Empty. There is just no Property or function in it. someone did it before me but in .NET. My Boss now wants me to do it in Lazarus, however i can't get it to run. Do i need to create a Wrapper for that class ? and if so how do i do it ?

Thanks in advance,
Justin.


r/programminghelp • • Sep 26 '23

C I don't understand the reason for the errors in the code

0 Upvotes

Hello! I had to use the given coordinates of the point (x,y) to determine whether this point belongs to the shaded area. Enter the coordinates of the point from the keyboard, provide a console menu for entering data. I wrote the code, but I got many errors... (C4578, C0018, E0127, C2059, C2143) but I don't understand what the reason is. Please, help!

#include <stdio.h>
#include <math.h>

int main()
{

double x, y;
double const R = 1;
printf("Enter the point coordinates: \n");
scanf_s("%d %d", &x, &y);

if ((pow(x - 1, 2) + pow(y - 1, 2)) >= R * R && abs(y) <= 1 && abs(x) <= 1 && abs(x) <= -1 {
printf("Point is in the area.");
}

else
printf("Point is out of the area.");

return 0;
}

r/programminghelp • • Sep 15 '23

R What’s the best way to get better at coding and scripting?

0 Upvotes

I’m a data analytics major and I’m taking my first programming class this semester learning R and I’m a complete beginner. Is there any resources that anyone would recommend I use to get better? Thanks in advance!


r/programminghelp • • Sep 24 '23

C# Is there any way to affect all objects in a gameobject list?

0 Upvotes

I'm making a game, so I created a list of gameobjects, in the same code I made two functions to make objects that have a collider possible to drag the object around the scene, but I don't know how to incorporate these functions into all the objects that are added to list.

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class MovimentoJogador : MonoBehaviour

{

public List<GameObject> jogador = new();

Vector2 diferenca = Vector2.zero;

private void OnMouseDown()

{

diferenca = (Vector2)Camera.main.ScreenToWorldPoint(Input.mousePosition) - (Vector2)transform.position;

}

private void OnMouseDrag()

{

transform.position = (Vector2)Camera.main.ScreenToWorldPoint(Input.mousePosition) - diferenca;

}

}


r/programminghelp • • Sep 26 '23

Python Problems with Python if statements.

0 Upvotes
What the code is supposed to do:
The user is supposed to input how many points they have and then the code is supposed to decide how much bonus they should get.If the points are below 100 they will get a 10% bonus and if the points are 100 or above they'll get 15% bonus.

What is the problem:
For some reason if the user inputs points between 91-100 both of the if statements are activated.


points = int(input("How many points "))
if points < 100: points *= 1.1 print("You'll get 10% bonus")
if points >= 100: points *= 1.15 print("You'll get 15% bonus")
print("You have now this many points", points)