What if the malian empire of shongai built a port on the coast on modern senegal, brought guns and traded with the portuguese in exchange for Ivory, slaves and gold etc, would they be able to hold off against the Moroccan invasions? or european colonization? in my opinion it would probably become very wealthy again, using that wealth too expand it empire and technology, it would probably not last with the shingai dynasty, but still maintain its status as an independant nation, probably even in the 19th century it would develop industry in the area. having been a center of leaning of thousands of years it would also heavely invest in the school system, most likely having a very high literacy rate that would last to this day. perhaps it would even be a major world power, and a large factor in reshaping africa, probably even stopping european coloization of west africa.